home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gcc_260.zip / gcc_260 / final.c < prev    next >
C/C++ Source or Header  |  1994-07-12  |  82KB  |  3,066 lines

  1. /* Convert RTL to assembler code and output it, for GNU compiler.
  2.    Copyright (C) 1987, 88, 89, 92, 93, 1994 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. /* This is the final pass of the compiler.
  22.    It looks at the rtl code for a function and outputs assembler code.
  23.  
  24.    Call `final_start_function' to output the assembler code for function entry,
  25.    `final' to output assembler code for some RTL code,
  26.    `final_end_function' to output assembler code for function exit.
  27.    If a function is compiled in several pieces, each piece is
  28.    output separately with `final'.
  29.  
  30.    Some optimizations are also done at this level.
  31.    Move instructions that were made unnecessary by good register allocation
  32.    are detected and omitted from the output.  (Though most of these
  33.    are removed by the last jump pass.)
  34.  
  35.    Instructions to set the condition codes are omitted when it can be
  36.    seen that the condition codes already had the desired values.
  37.  
  38.    In some cases it is sufficient if the inherited condition codes
  39.    have related values, but this may require the following insn
  40.    (the one that tests the condition codes) to be modified.
  41.  
  42.    The code for the function prologue and epilogue are generated
  43.    directly as assembler code by the macros FUNCTION_PROLOGUE and
  44.    FUNCTION_EPILOGUE.  Those instructions never exist as rtl.  */
  45.  
  46. #include "config.h"
  47. #ifdef __STDC__
  48. #include <stdarg.h>
  49. #else
  50. #include <varargs.h>
  51. #endif
  52. #include <stdio.h>
  53. #include <ctype.h>
  54.  
  55. #include "tree.h"
  56. #include "rtl.h"
  57. #include "regs.h"
  58. #include "insn-config.h"
  59. #include "insn-flags.h"
  60. #include "insn-attr.h"
  61. #include "insn-codes.h"
  62. #include "recog.h"
  63. #include "conditions.h"
  64. #include "flags.h"
  65. #include "real.h"
  66. #include "hard-reg-set.h"
  67. #include "defaults.h"
  68. #include "output.h"
  69.  
  70. /* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist.  */
  71. #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
  72. #if defined (USG) || defined (NO_STAB_H)
  73. #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  74. #else
  75. #include <stab.h>  /* On BSD, use the system's stab.h.  */
  76. #endif /* not USG */
  77. #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
  78.  
  79. #ifdef XCOFF_DEBUGGING_INFO
  80. #include "xcoffout.h"
  81. #endif
  82.  
  83. /* .stabd code for line number.  */
  84. #ifndef N_SLINE
  85. #define    N_SLINE    0x44
  86. #endif
  87.  
  88. /* .stabs code for included file name.  */
  89. #ifndef N_SOL
  90. #define    N_SOL 0x84
  91. #endif
  92.  
  93. #ifndef INT_TYPE_SIZE
  94. #define INT_TYPE_SIZE BITS_PER_WORD
  95. #endif
  96.  
  97. /* If we aren't using cc0, CC_STATUS_INIT shouldn't exist.  So define a
  98.    null default for it to save conditionalization later.  */
  99. #ifndef CC_STATUS_INIT
  100. #define CC_STATUS_INIT
  101. #endif
  102.  
  103. /* How to start an assembler comment.  */
  104. #ifndef ASM_COMMENT_START
  105. #define ASM_COMMENT_START ";#"
  106. #endif
  107.  
  108. /* Is the given character a logical line separator for the assembler?  */
  109. #ifndef IS_ASM_LOGICAL_LINE_SEPARATOR
  110. #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == ';')
  111. #endif
  112.  
  113. /* Nonzero means this function is a leaf function, with no function calls. 
  114.    This variable exists to be examined in FUNCTION_PROLOGUE
  115.    and FUNCTION_EPILOGUE.  Always zero, unless set by some action.  */
  116. int leaf_function;
  117.  
  118. /* Last insn processed by final_scan_insn.  */
  119. static rtx debug_insn = 0;
  120.  
  121. /* Line number of last NOTE.  */
  122. static int last_linenum;
  123.  
  124. /* Filename of last NOTE.  */
  125. static char *last_filename;
  126.  
  127. /* Number of basic blocks seen so far;
  128.    used if profile_block_flag is set.  */
  129. static int count_basic_blocks;
  130.  
  131. /* Nonzero while outputting an `asm' with operands.
  132.    This means that inconsistencies are the user's fault, so don't abort.
  133.    The precise value is the insn being output, to pass to error_for_asm.  */
  134. static rtx this_is_asm_operands;
  135.  
  136. /* Number of operands of this insn, for an `asm' with operands.  */
  137. static int insn_noperands;
  138.  
  139. /* Compare optimization flag.  */
  140.  
  141. static rtx last_ignored_compare = 0;
  142.  
  143. /* Flag indicating this insn is the start of a new basic block.  */
  144.  
  145. static int new_block = 1;
  146.  
  147. /* All the symbol-blocks (levels of scoping) in the compilation
  148.    are assigned sequence numbers in order of appearance of the
  149.    beginnings of the symbol-blocks.  Both final and dbxout do this,
  150.    and assume that they will both give the same number to each block.
  151.    Final uses these sequence numbers to generate assembler label names
  152.    LBBnnn and LBEnnn for the beginning and end of the symbol-block.
  153.    Dbxout uses the sequence numbers to generate references to the same labels
  154.    from the dbx debugging information.
  155.  
  156.    Sdb records this level at the beginning of each function,
  157.    in order to find the current level when recursing down declarations.
  158.    It outputs the block beginning and endings
  159.    at the point in the asm file where the blocks would begin and end.  */
  160.  
  161. int next_block_index;
  162.  
  163. /* Assign a unique number to each insn that is output.
  164.    This can be used to generate unique local labels.  */
  165.  
  166. static int insn_counter = 0;
  167.  
  168. #ifdef HAVE_cc0
  169. /* This variable contains machine-dependent flags (defined in tm.h)
  170.    set and examined by output routines
  171.    that describe how to interpret the condition codes properly.  */
  172.  
  173. CC_STATUS cc_status;
  174.  
  175. /* During output of an insn, this contains a copy of cc_status
  176.    from before the insn.  */
  177.  
  178. CC_STATUS cc_prev_status;
  179. #endif
  180.  
  181. /* Indexed by hardware reg number, is 1 if that register is ever
  182.    used in the current function.
  183.  
  184.    In life_analysis, or in stupid_life_analysis, this is set
  185.    up to record the hard regs used explicitly.  Reload adds
  186.    in the hard regs used for holding pseudo regs.  Final uses
  187.    it to generate the code in the function prologue and epilogue
  188.    to save and restore registers as needed.  */
  189.  
  190. char regs_ever_live[FIRST_PSEUDO_REGISTER];
  191.  
  192. /* Nonzero means current function must be given a frame pointer.
  193.    Set in stmt.c if anything is allocated on the stack there.
  194.    Set in reload1.c if anything is allocated on the stack there.  */
  195.  
  196. int frame_pointer_needed;
  197.  
  198. /* Assign unique numbers to labels generated for profiling.  */
  199.  
  200. int profile_label_no;
  201.  
  202. /* Length so far allocated in PENDING_BLOCKS.  */
  203.  
  204. static int max_block_depth;
  205.  
  206. /* Stack of sequence numbers of symbol-blocks of which we have seen the
  207.    beginning but not yet the end.  Sequence numbers are assigned at
  208.    the beginning; this stack allows us to find the sequence number
  209.    of a block that is ending.  */
  210.  
  211. static int *pending_blocks;
  212.  
  213. /* Number of elements currently in use in PENDING_BLOCKS.  */
  214.  
  215. static int block_depth;
  216.  
  217. /* Nonzero if have enabled APP processing of our assembler output.  */
  218.  
  219. static int app_on;
  220.  
  221. /* If we are outputting an insn sequence, this contains the sequence rtx.
  222.    Zero otherwise.  */
  223.  
  224. rtx final_sequence;
  225.  
  226. #ifdef ASSEMBLER_DIALECT
  227.  
  228. /* Number of the assembler dialect to use, starting at 0.  */
  229. static int dialect_number;
  230. #endif
  231.  
  232. /* Indexed by line number, nonzero if there is a note for that line.  */
  233.  
  234. static char *line_note_exists;
  235.  
  236. /* Linked list to hold line numbers for each basic block.  */
  237.  
  238. struct bb_list {
  239.   struct bb_list *next;        /* pointer to next basic block */
  240.   int line_num;            /* line number */
  241.   int file_label_num;        /* LPBC<n> label # for stored filename */
  242.   int func_label_num;        /* LPBC<n> label # for stored function name */
  243. };
  244.  
  245. static struct bb_list *bb_head    = 0;        /* Head of basic block list */
  246. static struct bb_list **bb_tail = &bb_head;    /* Ptr to store next bb ptr */
  247. static int bb_file_label_num    = -1;        /* Current label # for file */
  248. static int bb_func_label_num    = -1;        /* Current label # for func */
  249.  
  250. /* Linked list to hold the strings for each file and function name output.  */
  251.  
  252. struct bb_str {
  253.   struct bb_str *next;        /* pointer to next string */
  254.   char *string;            /* string */
  255.   int label_num;        /* label number */
  256.   int length;            /* string length */
  257. };
  258.  
  259. extern rtx peephole        PROTO((rtx));
  260.  
  261. static struct bb_str *sbb_head    = 0;        /* Head of string list.  */
  262. static struct bb_str **sbb_tail    = &sbb_head;    /* Ptr to store next bb str */
  263. static int sbb_label_num    = 0;        /* Last label used */
  264.  
  265. static int asm_insn_count    PROTO((rtx));
  266. static void profile_function    PROTO((FILE *));
  267. static void profile_after_prologue PROTO((FILE *));
  268. static void add_bb        PROTO((FILE *));
  269. static int add_bb_string    PROTO((char *, int));
  270. static void output_source_line    PROTO((FILE *, rtx));
  271. static rtx walk_alter_subreg    PROTO((rtx));
  272. static int alter_cond        PROTO((rtx));
  273. static void output_operand    PROTO((rtx, int));
  274. static void leaf_renumber_regs    PROTO((rtx));
  275.  
  276. extern char *getpwd ();
  277.  
  278. /* Initialize data in final at the beginning of a compilation.  */
  279.  
  280. void
  281. init_final (filename)
  282.      char *filename;
  283. {
  284.   next_block_index = 2;
  285.   app_on = 0;
  286.   max_block_depth = 20;
  287.   pending_blocks = (int *) xmalloc (20 * sizeof *pending_blocks);
  288.   final_sequence = 0;
  289.  
  290. #ifdef ASSEMBLER_DIALECT
  291.   dialect_number = ASSEMBLER_DIALECT;
  292. #endif
  293. }
  294.  
  295. /* Called at end of source file,
  296.    to output the block-profiling table for this entire compilation.  */
  297.  
  298. void
  299. end_final (filename)
  300.      char *filename;
  301. {
  302.   int i;
  303.  
  304.   if (profile_block_flag)
  305.     {
  306.       char name[20];
  307.       int align = exact_log2 (BIGGEST_ALIGNMENT / BITS_PER_UNIT);
  308.       int size = (POINTER_SIZE / BITS_PER_UNIT) * count_basic_blocks;
  309.       int rounded = size;
  310.       struct bb_list *ptr;
  311.       struct bb_str *sptr;
  312.  
  313.       rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1;
  314.       rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
  315.          * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
  316.  
  317.       data_section ();
  318.  
  319.       /* Output the main header, of 10 words:
  320.      0:  1 if this file's initialized, else 0.
  321.      1:  address of file name (LPBX1).
  322.      2:  address of table of counts (LPBX2).
  323.      3:  number of counts in the table.
  324.      4:  always 0, for compatibility with Sun.
  325.  
  326.          The following are GNU extensions:
  327.  
  328.      5:  address of table of start addrs of basic blocks (LPBX3).
  329.      6:  Number of bytes in this header.
  330.      7:  address of table of function names (LPBX4).
  331.      8:  address of table of line numbers (LPBX5) or 0.
  332.      9:  address of table of file names (LPBX6) or 0.  */
  333.  
  334.       ASM_OUTPUT_ALIGN (asm_out_file, align);
  335.  
  336.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 0);
  337.       /* zero word */
  338.       assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  339.  
  340.       /* address of filename */
  341.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
  342.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  343.  
  344.       /* address of count table */
  345.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
  346.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  347.  
  348.       /* count of the # of basic blocks */
  349.       assemble_integer (GEN_INT (count_basic_blocks), UNITS_PER_WORD, 1);
  350.  
  351.       /* zero word (link field) */
  352.       assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  353.  
  354.       /* address of basic block start address table */
  355.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3);
  356.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  357.  
  358.       /* byte count for extended structure.  */
  359.       assemble_integer (GEN_INT (10 * UNITS_PER_WORD), UNITS_PER_WORD, 1);
  360.  
  361.       /* address of function name table */
  362.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 4);
  363.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  364.  
  365.       /* address of line number and filename tables if debugging.  */
  366.       if (write_symbols != NO_DEBUG)
  367.     {
  368.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 5);
  369.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  370.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 6);
  371.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  372.     }
  373.       else
  374.     {
  375.       assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  376.       assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  377.     }
  378.  
  379.       /* Output the file name changing the suffix to .d for Sun tcov
  380.      compatibility.  */
  381.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 1);
  382.       {
  383.     char *cwd = getpwd ();
  384.     int len = strlen (filename) + strlen (cwd) + 1;
  385.     char *data_file = (char *) alloca (len + 4);
  386.  
  387.     strcpy (data_file, cwd);
  388.     strcat (data_file, "/");
  389.     strcat (data_file, filename);
  390.     strip_off_ending (data_file, len);
  391.     strcat (data_file, ".d");
  392.     assemble_string (data_file, strlen (data_file) + 1);
  393.       }
  394.  
  395.       /* Make space for the table of counts.  */
  396.       if (flag_no_common || size == 0)
  397.     {
  398.       /* Realign data section.  */
  399.       ASM_OUTPUT_ALIGN (asm_out_file, align);
  400.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 2);
  401.       if (size != 0)
  402.         assemble_zeros (size);
  403.     }
  404.       else
  405.     {
  406.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
  407. #ifdef ASM_OUTPUT_SHARED_LOCAL
  408.       if (flag_shared_data)
  409.         ASM_OUTPUT_SHARED_LOCAL (asm_out_file, name, size, rounded);
  410.       else
  411. #endif
  412. #ifdef ASM_OUTPUT_ALIGNED_LOCAL
  413.         ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size,
  414.                       BIGGEST_ALIGNMENT);
  415. #else
  416.         ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
  417. #endif
  418.     }
  419.  
  420.       /* Output any basic block strings */
  421.       readonly_data_section ();
  422.       if (sbb_head)
  423.     {
  424.       ASM_OUTPUT_ALIGN (asm_out_file, align);
  425.       for (sptr = sbb_head; sptr != 0; sptr = sptr->next)
  426.         {
  427.           ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBC", sptr->label_num);
  428.           assemble_string (sptr->string, sptr->length);
  429.         }
  430.     }
  431.  
  432.       /* Output the table of addresses.  */
  433.       /* Realign in new section */
  434.       ASM_OUTPUT_ALIGN (asm_out_file, align);
  435.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 3);
  436.       for (i = 0; i < count_basic_blocks; i++)
  437.     {
  438.       ASM_GENERATE_INTERNAL_LABEL (name, "LPB", i);
  439.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name),
  440.                 UNITS_PER_WORD, 1);
  441.     }
  442.  
  443.       /* Output the table of function names.  */
  444.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 4);
  445.       for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++)
  446.     {
  447.       if (ptr->func_label_num >= 0)
  448.         {
  449.           ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", ptr->func_label_num);
  450.           assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name),
  451.                 UNITS_PER_WORD, 1);
  452.         }
  453.       else
  454.         assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  455.     }
  456.  
  457.       for ( ; i < count_basic_blocks; i++)
  458.     assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  459.  
  460.       if (write_symbols != NO_DEBUG)
  461.     {
  462.       /* Output the table of line numbers.  */
  463.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 5);
  464.       for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++)
  465.         assemble_integer (GEN_INT (ptr->line_num), UNITS_PER_WORD, 1);
  466.  
  467.       for ( ; i < count_basic_blocks; i++)
  468.         assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  469.  
  470.       /* Output the table of file names.  */
  471.       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 6);
  472.       for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++)
  473.         {
  474.           if (ptr->file_label_num >= 0)
  475.         {
  476.           ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", ptr->file_label_num);
  477.           assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name),
  478.                     UNITS_PER_WORD, 1);
  479.         }
  480.           else
  481.         assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  482.         }
  483.  
  484.       for ( ; i < count_basic_blocks; i++)
  485.         assemble_integer (const0_rtx, UNITS_PER_WORD, 1);
  486.     }
  487.  
  488.       /* End with the address of the table of addresses,
  489.      so we can find it easily, as the last word in the file's text.  */
  490.       ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3);
  491.       assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1);
  492.     }
  493. }
  494.  
  495. /* Enable APP processing of subsequent output.
  496.    Used before the output from an `asm' statement.  */
  497.  
  498. void
  499. app_enable ()
  500. {
  501.   if (! app_on)
  502.     {
  503.       fprintf (asm_out_file, ASM_APP_ON);
  504.       app_on = 1;
  505.     }
  506. }
  507.  
  508. /* Disable APP processing of subsequent output.
  509.    Called from varasm.c before most kinds of output.  */
  510.  
  511. void
  512. app_disable ()
  513. {
  514.   if (app_on)
  515.     {
  516.       fprintf (asm_out_file, ASM_APP_OFF);
  517.       app_on = 0;
  518.     }
  519. }
  520.  
  521. /* Return the number of slots filled in the current 
  522.    delayed branch sequence (we don't count the insn needing the
  523.    delay slot).   Zero if not in a delayed branch sequence.  */
  524.  
  525. #ifdef DELAY_SLOTS
  526. int
  527. dbr_sequence_length ()
  528. {
  529.   if (final_sequence != 0)
  530.     return XVECLEN (final_sequence, 0) - 1;
  531.   else
  532.     return 0;
  533. }
  534. #endif
  535.  
  536. /* The next two pages contain routines used to compute the length of an insn
  537.    and to shorten branches.  */
  538.  
  539. /* Arrays for insn lengths, and addresses.  The latter is referenced by
  540.    `insn_current_length'.  */
  541.  
  542. static short *insn_lengths;
  543. int *insn_addresses;
  544.  
  545. /* Address of insn being processed.  Used by `insn_current_length'.  */
  546. int insn_current_address;
  547.  
  548. /* Indicate that branch shortening hasn't yet been done.  */
  549.  
  550. void
  551. init_insn_lengths ()
  552. {
  553.   insn_lengths = 0;
  554. }
  555.  
  556. /* Obtain the current length of an insn.  If branch shortening has been done,
  557.    get its actual length.  Otherwise, get its maximum length.  */
  558.  
  559. int
  560. get_attr_length (insn)
  561.      rtx insn;
  562. {
  563. #ifdef HAVE_ATTR_length
  564.   rtx body;
  565.   int i;
  566.   int length = 0;
  567.  
  568.   if (insn_lengths)
  569.     return insn_lengths[INSN_UID (insn)];
  570.   else
  571.     switch (GET_CODE (insn))
  572.       {
  573.       case NOTE:
  574.       case BARRIER:
  575.       case CODE_LABEL:
  576.     return 0;
  577.  
  578.       case CALL_INSN:
  579.     length = insn_default_length (insn);
  580.     break;
  581.  
  582.       case JUMP_INSN:
  583.     body = PATTERN (insn);
  584.         if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
  585.       {
  586.         /* This only takes room if jump tables go into the text section.  */
  587. #if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
  588.         length = (XVECLEN (body, GET_CODE (body) == ADDR_DIFF_VEC)
  589.               * GET_MODE_SIZE (GET_MODE (body)));
  590.  
  591.         /* Be pessimistic and assume worst-case alignment.  */
  592.         length += (GET_MODE_SIZE (GET_MODE (body)) - 1);
  593. #else
  594.         return 0;
  595. #endif
  596.       }
  597.     else
  598.       length = insn_default_length (insn);
  599.     break;
  600.  
  601.       case INSN:
  602.     body = PATTERN (insn);
  603.     if (GET_CODE (body) == USE || GET_CODE (body) == CLOBBER)
  604.       return 0;
  605.  
  606.     else if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0)
  607.       length = asm_insn_count (body) * insn_default_length (insn);
  608.     else if (GET_CODE (body) == SEQUENCE)
  609.       for (i = 0; i < XVECLEN (body, 0); i++)
  610.         length += get_attr_length (XVECEXP (body, 0, i));
  611.     else
  612.       length = insn_default_length (insn);
  613.       }
  614.  
  615. #ifdef ADJUST_INSN_LENGTH
  616.   ADJUST_INSN_LENGTH (insn, length);
  617. #endif
  618.   return length;
  619. #else /* not HAVE_ATTR_length */
  620.   return 0;
  621. #endif /* not HAVE_ATTR_length */
  622. }
  623.  
  624. /* Make a pass over all insns and compute their actual lengths by shortening
  625.    any branches of variable length if possible.  */
  626.  
  627. /* Give a default value for the lowest address in a function.  */
  628.  
  629. #ifndef FIRST_INSN_ADDRESS
  630. #define FIRST_INSN_ADDRESS 0
  631. #endif
  632.  
  633. void
  634. shorten_branches (first)
  635.      rtx first;
  636. {
  637. #ifdef HAVE_ATTR_length
  638.   rtx insn;
  639.   int something_changed = 1;
  640.   int max_uid = 0;
  641.   char *varying_length;
  642.   rtx body;
  643.   int uid;
  644.  
  645.   /* Compute maximum UID and allocate arrays.  */
  646.   for (insn = first; insn; insn = NEXT_INSN (insn))
  647.     if (INSN_UID (insn) > max_uid)
  648.       max_uid = INSN_UID (insn);
  649.  
  650.   max_uid++;
  651.   insn_lengths = (short *) oballoc (max_uid * sizeof (short));
  652.   insn_addresses = (int *) oballoc (max_uid * sizeof (int));
  653.   varying_length = (char *) oballoc (max_uid * sizeof (char));
  654.  
  655.   /* Compute initial lengths, addresses, and varying flags for each insn.  */
  656.   for (insn_current_address = FIRST_INSN_ADDRESS, insn = first;
  657.        insn != 0;
  658.        insn_current_address += insn_lengths[uid], insn = NEXT_INSN (insn))
  659.     {
  660.       uid = INSN_UID (insn);
  661.       insn_addresses[uid] = insn_current_address;
  662.       insn_lengths[uid] = 0;
  663.       varying_length[uid] = 0;
  664.       
  665.       if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
  666.       || GET_CODE (insn) == CODE_LABEL)
  667.     continue;
  668.  
  669.       body = PATTERN (insn);
  670.       if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
  671.     {
  672.       /* This only takes room if read-only data goes into the text
  673.          section.  */
  674. #if !defined(READONLY_DATA_SECTION) || defined(JUMP_TABLES_IN_TEXT_SECTION)
  675.       int unitsize = GET_MODE_SIZE (GET_MODE (body));
  676.  
  677.       insn_lengths[uid] = (XVECLEN (body, GET_CODE (body) == ADDR_DIFF_VEC)
  678.                    * GET_MODE_SIZE (GET_MODE (body)));
  679.  
  680.       /* Account for possible alignment.  */
  681.       insn_lengths[uid]
  682.         += unitsize - (insn_current_address & (unitsize - 1));
  683. #else
  684.       ;
  685. #endif
  686.     }
  687.       else if (asm_noperands (body) >= 0)
  688.     insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn);
  689.       else if (GET_CODE (body) == SEQUENCE)
  690.     {
  691.       int i;
  692.       int const_delay_slots;
  693. #ifdef DELAY_SLOTS
  694.       const_delay_slots = const_num_delay_slots (XVECEXP (body, 0, 0));
  695. #else
  696.       const_delay_slots = 0;
  697. #endif
  698.       /* Inside a delay slot sequence, we do not do any branch shortening
  699.          if the shortening could change the number of delay slots
  700.          of the branch. */
  701.       for (i = 0; i < XVECLEN (body, 0); i++)
  702.         {
  703.           rtx inner_insn = XVECEXP (body, 0, i);
  704.           int inner_uid = INSN_UID (inner_insn);
  705.           int inner_length;
  706.  
  707.           if (asm_noperands (PATTERN (XVECEXP (body, 0, i))) >= 0)
  708.         inner_length = (asm_insn_count (PATTERN (inner_insn))
  709.                 * insn_default_length (inner_insn));
  710.           else
  711.         inner_length = insn_default_length (inner_insn);
  712.           
  713.           insn_lengths[inner_uid] = inner_length;
  714.           if (const_delay_slots)
  715.         {
  716.           if ((varying_length[inner_uid]
  717.                = insn_variable_length_p (inner_insn)) != 0)
  718.             varying_length[uid] = 1;
  719.           insn_addresses[inner_uid] = (insn_current_address +
  720.                            insn_lengths[uid]);
  721.         }
  722.           else
  723.         varying_length[inner_uid] = 0;
  724.           insn_lengths[uid] += inner_length;
  725.         }
  726.     }
  727.       else if (GET_CODE (body) != USE && GET_CODE (body) != CLOBBER)
  728.     {
  729.       insn_lengths[uid] = insn_default_length (insn);
  730.       varying_length[uid] = insn_variable_length_p (insn);
  731.     }
  732.  
  733.       /* If needed, do any adjustment.  */
  734. #ifdef ADJUST_INSN_LENGTH
  735.       ADJUST_INSN_LENGTH (insn, insn_lengths[uid]);
  736. #endif
  737.     }
  738.  
  739.   /* Now loop over all the insns finding varying length insns.  For each,
  740.      get the current insn length.  If it has changed, reflect the change.
  741.      When nothing changes for a full pass, we are done.  */
  742.  
  743.   while (something_changed)
  744.     {
  745.       something_changed = 0;
  746.       for (insn_current_address = FIRST_INSN_ADDRESS, insn = first;
  747.        insn != 0;
  748.        insn = NEXT_INSN (insn))
  749.     {
  750.       int new_length;
  751.       int tmp_length;
  752.  
  753.       uid = INSN_UID (insn);
  754.       insn_addresses[uid] = insn_current_address;
  755.       if (! varying_length[uid])
  756.         {
  757.           insn_current_address += insn_lengths[uid];
  758.           continue;
  759.         }
  760.       if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE)
  761.         {
  762.           int i;
  763.           
  764.           body = PATTERN (insn);
  765.           new_length = 0;
  766.           for (i = 0; i < XVECLEN (body, 0); i++)
  767.         {
  768.           rtx inner_insn = XVECEXP (body, 0, i);
  769.           int inner_uid = INSN_UID (inner_insn);
  770.           int inner_length;
  771.  
  772.           insn_addresses[inner_uid] = insn_current_address;
  773.  
  774.           /* insn_current_length returns 0 for insns with a
  775.              non-varying length.  */
  776.           if (! varying_length[inner_uid])
  777.             inner_length = insn_lengths[inner_uid];
  778.           else
  779.             inner_length = insn_current_length (inner_insn);
  780.  
  781.           if (inner_length != insn_lengths[inner_uid])
  782.             {
  783.               insn_lengths[inner_uid] = inner_length;
  784.               something_changed = 1;
  785.             }
  786.           insn_current_address += insn_lengths[inner_uid];
  787.           new_length += inner_length;
  788.         }
  789.         }
  790.       else
  791.         {
  792.           new_length = insn_current_length (insn);
  793.           insn_current_address += new_length;
  794.         }
  795.  
  796. #ifdef SHORTEN_WITH_ADJUST_INSN_LENGTH
  797. #ifdef ADJUST_INSN_LENGTH
  798.       /* If needed, do any adjustment.  */
  799.       tmp_length = new_length;
  800.       ADJUST_INSN_LENGTH (insn, new_length);
  801.       insn_current_address += (new_length - tmp_length);
  802. #endif
  803. #endif
  804.  
  805.       if (new_length != insn_lengths[uid])
  806.         {
  807.           insn_lengths[uid] = new_length;
  808.           something_changed = 1;
  809.         }
  810.     }
  811.     }
  812. #endif /* HAVE_ATTR_length */
  813. }
  814.  
  815. #ifdef HAVE_ATTR_length
  816. /* Given the body of an INSN known to be generated by an ASM statement, return
  817.    the number of machine instructions likely to be generated for this insn.
  818.    This is used to compute its length.  */
  819.  
  820. static int
  821. asm_insn_count (body)
  822.      rtx body;
  823. {
  824.   char *template;
  825.   int count = 1;
  826.  
  827.   for (template = decode_asm_operands (body, NULL_PTR, NULL_PTR,
  828.                        NULL_PTR, NULL_PTR);
  829.        *template; template++)
  830.     if (IS_ASM_LOGICAL_LINE_SEPARATOR(*template) || *template == '\n')
  831.       count++;
  832.  
  833.   return count;
  834. }
  835. #endif
  836.  
  837. /* Output assembler code for the start of a function,
  838.    and initialize some of the variables in this file
  839.    for the new function.  The label for the function and associated
  840.    assembler pseudo-ops have already been output in `assemble_start_function'.
  841.  
  842.    FIRST is the first insn of the rtl for the function being compiled.
  843.    FILE is the file to write assembler code to.
  844.    OPTIMIZE is nonzero if we should eliminate redundant
  845.      test and compare insns.  */
  846.  
  847. void
  848. final_start_function (first, file, optimize)
  849.      rtx first;
  850.      FILE *file;
  851.      int optimize;
  852. {
  853.   block_depth = 0;
  854.  
  855.   this_is_asm_operands = 0;
  856.  
  857. #ifdef NON_SAVING_SETJMP
  858.   /* A function that calls setjmp should save and restore all the
  859.      call-saved registers on a system where longjmp clobbers them.  */
  860.   if (NON_SAVING_SETJMP && current_function_calls_setjmp)
  861.     {
  862.       int i;
  863.  
  864.       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
  865.     if (!call_used_regs[i] && !call_fixed_regs[i])
  866.       regs_ever_live[i] = 1;
  867.     }
  868. #endif
  869.   
  870.   /* Initial line number is supposed to be output
  871.      before the function's prologue and label
  872.      so that the function's address will not appear to be
  873.      in the last statement of the preceding function.  */
  874.   if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
  875.     {
  876.       if (write_symbols == SDB_DEBUG)
  877.     /* For sdb, let's not, but say we did.
  878.        We need to set last_linenum for sdbout_function_begin,
  879.        but we can't have an actual line number before the .bf symbol.
  880.        (sdb_begin_function_line is not set,
  881.        and other compilers don't do it.)  */
  882.     last_linenum = NOTE_LINE_NUMBER (first);
  883. #ifdef XCOFF_DEBUGGING_INFO
  884.       else if (write_symbols == XCOFF_DEBUG)
  885.     {
  886.       last_linenum = NOTE_LINE_NUMBER (first);
  887.       xcoffout_output_first_source_line (file, last_linenum);
  888.     }
  889. #endif      
  890.       else
  891.     output_source_line (file, first);
  892.     }
  893.  
  894. #ifdef LEAF_REG_REMAP
  895.   if (leaf_function)
  896.     leaf_renumber_regs (first);
  897. #endif
  898.  
  899.   /* The Sun386i and perhaps other machines don't work right
  900.      if the profiling code comes after the prologue.  */
  901. #ifdef PROFILE_BEFORE_PROLOGUE
  902.   if (profile_flag)
  903.     profile_function (file);
  904. #endif /* PROFILE_BEFORE_PROLOGUE */
  905.  
  906. #ifdef FUNCTION_PROLOGUE
  907.   /* First output the function prologue: code to set up the stack frame.  */
  908.   FUNCTION_PROLOGUE (file, get_frame_size ());
  909. #endif
  910.  
  911. #if defined (SDB_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
  912.   if (write_symbols == SDB_DEBUG || write_symbols == XCOFF_DEBUG)
  913.     next_block_index = 1;
  914. #endif
  915.  
  916.   /* If the machine represents the prologue as RTL, the profiling code must
  917.      be emitted when NOTE_INSN_PROLOGUE_END is scanned.  */
  918. #ifdef HAVE_prologue
  919.   if (! HAVE_prologue)
  920. #endif
  921.     profile_after_prologue (file);
  922.  
  923.   profile_label_no++;
  924.  
  925.   /* If we are doing basic block profiling, remember a printable version
  926.      of the function name.  */
  927.   if (profile_block_flag)
  928.     {
  929.       char *junk = "function";
  930.       bb_func_label_num =
  931.     add_bb_string ((*decl_printable_name) (current_function_decl, &junk), FALSE);
  932.     }
  933. }
  934.  
  935. static void
  936. profile_after_prologue (file)
  937.      FILE *file;
  938. {
  939. #ifdef FUNCTION_BLOCK_PROFILER
  940.   if (profile_block_flag)
  941.     {
  942.       FUNCTION_BLOCK_PROFILER (file, profile_label_no);
  943.     }
  944. #endif /* FUNCTION_BLOCK_PROFILER */
  945.  
  946. #ifndef PROFILE_BEFORE_PROLOGUE
  947.   if (profile_flag)
  948.     profile_function (file);
  949. #endif /* not PROFILE_BEFORE_PROLOGUE */
  950. }
  951.  
  952. static void
  953. profile_function (file)
  954.      FILE *file;
  955. {
  956.   int align = MIN (BIGGEST_ALIGNMENT, POINTER_SIZE);
  957.   int sval = current_function_returns_struct;
  958.   int cxt = current_function_needs_context;
  959.  
  960.   data_section ();
  961.   ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
  962.   ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
  963.   assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
  964.  
  965.   text_section ();
  966.  
  967. #ifdef STRUCT_VALUE_INCOMING_REGNUM
  968.   if (sval)
  969.     ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_INCOMING_REGNUM);
  970. #else
  971. #ifdef STRUCT_VALUE_REGNUM
  972.   if (sval)
  973.     ASM_OUTPUT_REG_PUSH (file, STRUCT_VALUE_REGNUM);
  974. #endif
  975. #endif
  976.  
  977. #if 0
  978. #ifdef STATIC_CHAIN_INCOMING_REGNUM
  979.   if (cxt)
  980.     ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_INCOMING_REGNUM);
  981. #else
  982. #ifdef STATIC_CHAIN_REGNUM
  983.   if (cxt)
  984.     ASM_OUTPUT_REG_PUSH (file, STATIC_CHAIN_REGNUM);
  985. #endif
  986. #endif
  987. #endif                /* 0 */
  988.  
  989.   FUNCTION_PROFILER (file, profile_label_no);
  990.  
  991. #if 0
  992. #ifdef STATIC_CHAIN_INCOMING_REGNUM
  993.   if (cxt)
  994.     ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_INCOMING_REGNUM);
  995. #else
  996. #ifdef STATIC_CHAIN_REGNUM
  997.   if (cxt)
  998.     ASM_OUTPUT_REG_POP (file, STATIC_CHAIN_REGNUM);
  999. #endif
  1000. #endif
  1001. #endif                /* 0 */
  1002.  
  1003. #ifdef STRUCT_VALUE_INCOMING_REGNUM
  1004.   if (sval)
  1005.     ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_INCOMING_REGNUM);
  1006. #else
  1007. #ifdef STRUCT_VALUE_REGNUM
  1008.   if (sval)
  1009.     ASM_OUTPUT_REG_POP (file, STRUCT_VALUE_REGNUM);
  1010. #endif
  1011. #endif
  1012. }
  1013.  
  1014. /* Output assembler code for the end of a function.
  1015.    For clarity, args are same as those of `final_start_function'
  1016.    even though not all of them are needed.  */
  1017.  
  1018. void
  1019. final_end_function (first, file, optimize)
  1020.      rtx first;
  1021.      FILE *file;
  1022.      int optimize;
  1023. {
  1024.   if (app_on)
  1025.     {
  1026.       fprintf (file, ASM_APP_OFF);
  1027.       app_on = 0;
  1028.     }
  1029.  
  1030. #ifdef SDB_DEBUGGING_INFO
  1031.   if (write_symbols == SDB_DEBUG)
  1032.     sdbout_end_function (last_linenum);
  1033. #endif
  1034.  
  1035. #ifdef DWARF_DEBUGGING_INFO
  1036.   if (write_symbols == DWARF_DEBUG)
  1037.     dwarfout_end_function ();
  1038. #endif
  1039.  
  1040. #ifdef XCOFF_DEBUGGING_INFO
  1041.   if (write_symbols == XCOFF_DEBUG)
  1042.     xcoffout_end_function (file, last_linenum);
  1043. #endif
  1044.  
  1045. #ifdef FUNCTION_EPILOGUE
  1046.   /* Finally, output the function epilogue:
  1047.      code to restore the stack frame and return to the caller.  */
  1048.   FUNCTION_EPILOGUE (file, get_frame_size ());
  1049. #endif
  1050.  
  1051. #ifdef SDB_DEBUGGING_INFO
  1052.   if (write_symbols == SDB_DEBUG)
  1053.     sdbout_end_epilogue ();
  1054. #endif
  1055.  
  1056. #ifdef DWARF_DEBUGGING_INFO
  1057.   if (write_symbols == DWARF_DEBUG)
  1058.     dwarfout_end_epilogue ();
  1059. #endif
  1060.  
  1061. #ifdef XCOFF_DEBUGGING_INFO
  1062.   if (write_symbols == XCOFF_DEBUG)
  1063.     xcoffout_end_epilogue (file);
  1064. #endif
  1065.  
  1066.   bb_func_label_num = -1;    /* not in function, nuke label # */
  1067.  
  1068.   /* If FUNCTION_EPILOGUE is not defined, then the function body
  1069.      itself contains return instructions wherever needed.  */
  1070. }
  1071.  
  1072. /* Add a block to the linked list that remembers the current line/file/function
  1073.    for basic block profiling.  Emit the label in front of the basic block and
  1074.    the instructions that increment the count field.  */
  1075.  
  1076. static void
  1077. add_bb (file)
  1078.      FILE *file;
  1079. {
  1080.   struct bb_list *ptr = (struct bb_list *) permalloc (sizeof (struct bb_list));
  1081.  
  1082.   /* Add basic block to linked list.  */
  1083.   ptr->next = 0;
  1084.   ptr->line_num = last_linenum;
  1085.   ptr->file_label_num = bb_file_label_num;
  1086.   ptr->func_label_num = bb_func_label_num;
  1087.   *bb_tail = ptr;
  1088.   bb_tail = &ptr->next;
  1089.  
  1090.   /* Enable the table of basic-block use counts
  1091.      to point at the code it applies to.  */
  1092.   ASM_OUTPUT_INTERNAL_LABEL (file, "LPB", count_basic_blocks);
  1093.  
  1094.   /* Before first insn of this basic block, increment the
  1095.      count of times it was entered.  */
  1096. #ifdef BLOCK_PROFILER
  1097.   BLOCK_PROFILER (file, count_basic_blocks);
  1098.   CC_STATUS_INIT;
  1099. #endif
  1100.  
  1101.   new_block = 0;
  1102.   count_basic_blocks++;
  1103. }
  1104.  
  1105. /* Add a string to be used for basic block profiling.  */
  1106.  
  1107. static int
  1108. add_bb_string (string, perm_p)
  1109.      char *string;
  1110.      int perm_p;
  1111. {
  1112.   int len;
  1113.   struct bb_str *ptr = 0;
  1114.  
  1115.   if (!string)
  1116.     {
  1117.       string = "<unknown>";
  1118.       perm_p = TRUE;
  1119.     }
  1120.  
  1121.   /* Allocate a new string if the current string isn't permanent.  If
  1122.      the string is permanent search for the same string in other
  1123.      allocations.  */
  1124.  
  1125.   len = strlen (string) + 1;
  1126.   if (!perm_p)
  1127.     {
  1128.       char *p = (char *) permalloc (len);
  1129.       bcopy (string, p, len);
  1130.       string = p;
  1131.     }
  1132.   else
  1133.     for (ptr = sbb_head; ptr != (struct bb_str *)0; ptr = ptr->next)
  1134.       if (ptr->string == string)
  1135.     break;
  1136.  
  1137.   /* Allocate a new string block if we need to.  */
  1138.   if (!ptr)
  1139.     {
  1140.       ptr = (struct bb_str *) permalloc (sizeof (*ptr));
  1141.       ptr->next = 0;
  1142.       ptr->length = len;
  1143.       ptr->label_num = sbb_label_num++;
  1144.       ptr->string = string;
  1145.       *sbb_tail = ptr;
  1146.       sbb_tail = &ptr->next;
  1147.     }
  1148.  
  1149.   return ptr->label_num;
  1150. }
  1151.  
  1152.  
  1153. /* Output assembler code for some insns: all or part of a function.
  1154.    For description of args, see `final_start_function', above.
  1155.  
  1156.    PRESCAN is 1 if we are not really outputting,
  1157.      just scanning as if we were outputting.
  1158.    Prescanning deletes and rearranges insns just like ordinary output.
  1159.    PRESCAN is -2 if we are outputting after having prescanned.
  1160.    In this case, don't try to delete or rearrange insns
  1161.    because that has already been done.
  1162.    Prescanning is done only on certain machines.  */
  1163.  
  1164. void
  1165. final (first, file, optimize, prescan)
  1166.      rtx first;
  1167.      FILE *file;
  1168.      int optimize;
  1169.      int prescan;
  1170. {
  1171.   register rtx insn;
  1172.   int max_line = 0;
  1173.  
  1174.   last_ignored_compare = 0;
  1175.   new_block = 1;
  1176.  
  1177.   /* Make a map indicating which line numbers appear in this function.
  1178.      When producing SDB debugging info, delete troublesome line number
  1179.      notes from inlined functions in other files as well as duplicate
  1180.      line number notes.  */
  1181. #ifdef SDB_DEBUGGING_INFO
  1182.   if (write_symbols == SDB_DEBUG)
  1183.     {
  1184.       rtx last = 0;
  1185.       for (insn = first; insn; insn = NEXT_INSN (insn))
  1186.     if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
  1187.       {
  1188.         if ((RTX_INTEGRATED_P (insn)
  1189.          && strcmp (NOTE_SOURCE_FILE (insn), main_input_filename) != 0)
  1190.          || (last != 0
  1191.              && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last)
  1192.              && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last)))
  1193.           {
  1194.         NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
  1195.         NOTE_SOURCE_FILE (insn) = 0;
  1196.         continue;
  1197.           }
  1198.         last = insn;
  1199.         if (NOTE_LINE_NUMBER (insn) > max_line)
  1200.           max_line = NOTE_LINE_NUMBER (insn);
  1201.       }
  1202.     }
  1203.   else
  1204. #endif
  1205.     {
  1206.       for (insn = first; insn; insn = NEXT_INSN (insn))
  1207.     if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > max_line)
  1208.       max_line = NOTE_LINE_NUMBER (insn);
  1209.     }
  1210.  
  1211.   line_note_exists = (char *) oballoc (max_line + 1);
  1212.   bzero (line_note_exists, max_line + 1);
  1213.  
  1214.   for (insn = first; insn; insn = NEXT_INSN (insn))
  1215.     if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
  1216.       line_note_exists[NOTE_LINE_NUMBER (insn)] = 1;
  1217.  
  1218.   init_recog ();
  1219.  
  1220.   CC_STATUS_INIT;
  1221.  
  1222.   /* Output the insns.  */
  1223.   for (insn = NEXT_INSN (first); insn;)
  1224.     insn = final_scan_insn (insn, file, optimize, prescan, 0);
  1225.  
  1226.   /* Do basic-block profiling here
  1227.      if the last insn was a conditional branch.  */
  1228.   if (profile_block_flag && new_block)
  1229.     add_bb (file);
  1230. }
  1231.  
  1232. /* The final scan for one insn, INSN.
  1233.    Args are same as in `final', except that INSN
  1234.    is the insn being scanned.
  1235.    Value returned is the next insn to be scanned.
  1236.  
  1237.    NOPEEPHOLES is the flag to disallow peephole processing (currently
  1238.    used for within delayed branch sequence output).  */
  1239.  
  1240. rtx
  1241. final_scan_insn (insn, file, optimize, prescan, nopeepholes)
  1242.      rtx insn;
  1243.      FILE *file;
  1244.      int optimize;
  1245.      int prescan;
  1246.      int nopeepholes;
  1247. {
  1248.   register int i;
  1249.   insn_counter++;
  1250.  
  1251.   /* Ignore deleted insns.  These can occur when we split insns (due to a
  1252.      template of "#") while not optimizing.  */
  1253.   if (INSN_DELETED_P (insn))
  1254.     return NEXT_INSN (insn);
  1255.  
  1256.   switch (GET_CODE (insn))
  1257.     {
  1258.     case NOTE:
  1259.       if (prescan > 0)
  1260.     break;
  1261.  
  1262.       /* Align the beginning of a loop, for higher speed
  1263.      on certain machines.  */
  1264.  
  1265.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG && optimize > 0)
  1266.     {
  1267. #ifdef ASM_OUTPUT_LOOP_ALIGN
  1268.       rtx next = next_nonnote_insn (insn);
  1269.       if (next && GET_CODE (next) == CODE_LABEL)
  1270.         {
  1271.           ASM_OUTPUT_LOOP_ALIGN (asm_out_file);
  1272.         }
  1273. #endif
  1274.       break;
  1275.     }
  1276.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
  1277.     break;
  1278.  
  1279.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PROLOGUE_END)
  1280.     {
  1281. #ifdef FUNCTION_END_PROLOGUE
  1282.       FUNCTION_END_PROLOGUE (file);
  1283. #endif
  1284.       profile_after_prologue (file);
  1285.       break;
  1286.     }
  1287.  
  1288. #ifdef FUNCTION_BEGIN_EPILOGUE
  1289.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG)
  1290.     {
  1291.       FUNCTION_BEGIN_EPILOGUE (file);
  1292.       break;
  1293.     }
  1294. #endif
  1295.  
  1296.       if (write_symbols == NO_DEBUG)
  1297.     break;
  1298.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
  1299.     {
  1300. #ifdef SDB_DEBUGGING_INFO
  1301.       if (write_symbols == SDB_DEBUG)
  1302.         sdbout_begin_function (last_linenum);
  1303. #endif
  1304. #ifdef XCOFF_DEBUGGING_INFO
  1305.       if (write_symbols == XCOFF_DEBUG)
  1306.         xcoffout_begin_function (file, last_linenum);
  1307. #endif
  1308. #ifdef DWARF_DEBUGGING_INFO
  1309.       if (write_symbols == DWARF_DEBUG)
  1310.         dwarfout_begin_function ();
  1311. #endif
  1312.       break;
  1313.     }
  1314.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
  1315.     break;            /* An insn that was "deleted" */
  1316.       if (app_on)
  1317.     {
  1318.       fprintf (file, ASM_APP_OFF);
  1319.       app_on = 0;
  1320.     }
  1321.       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
  1322.       && (debug_info_level == DINFO_LEVEL_NORMAL
  1323.           || debug_info_level == DINFO_LEVEL_VERBOSE
  1324. #ifdef DWARF_DEBUGGING_INFO
  1325.           || write_symbols == DWARF_DEBUG
  1326. #endif
  1327.          )
  1328.      )
  1329.     {
  1330.       /* Beginning of a symbol-block.  Assign it a sequence number
  1331.          and push the number onto the stack PENDING_BLOCKS.  */
  1332.  
  1333.       if (block_depth == max_block_depth)
  1334.         {
  1335.           /* PENDING_BLOCKS is full; make it longer.  */
  1336.           max_block_depth *= 2;
  1337.           pending_blocks
  1338.         = (int *) xrealloc (pending_blocks,
  1339.                     max_block_depth * sizeof (int));
  1340.         }
  1341.       pending_blocks[block_depth++] = next_block_index;
  1342.  
  1343.       /* Output debugging info about the symbol-block beginning.  */
  1344.  
  1345. #ifdef SDB_DEBUGGING_INFO
  1346.       if (write_symbols == SDB_DEBUG)
  1347.         sdbout_begin_block (file, last_linenum, next_block_index);
  1348. #endif
  1349. #ifdef XCOFF_DEBUGGING_INFO
  1350.       if (write_symbols == XCOFF_DEBUG)
  1351.         xcoffout_begin_block (file, last_linenum, next_block_index);
  1352. #endif
  1353. #ifdef DBX_DEBUGGING_INFO
  1354.       if (write_symbols == DBX_DEBUG)
  1355.         ASM_OUTPUT_INTERNAL_LABEL (file, "LBB", next_block_index);
  1356. #endif
  1357. #ifdef DWARF_DEBUGGING_INFO
  1358.       if (write_symbols == DWARF_DEBUG && block_depth > 1)
  1359.         dwarfout_begin_block (next_block_index);
  1360. #endif
  1361.  
  1362.       next_block_index++;
  1363.     }
  1364.       else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END
  1365.            && (debug_info_level == DINFO_LEVEL_NORMAL
  1366.            || debug_info_level == DINFO_LEVEL_VERBOSE
  1367. #ifdef DWARF_DEBUGGING_INFO
  1368.                || write_symbols == DWARF_DEBUG
  1369. #endif
  1370.               )
  1371.           )
  1372.     {
  1373.       /* End of a symbol-block.  Pop its sequence number off
  1374.          PENDING_BLOCKS and output debugging info based on that.  */
  1375.  
  1376.       --block_depth;
  1377.  
  1378. #ifdef XCOFF_DEBUGGING_INFO
  1379.       if (write_symbols == XCOFF_DEBUG && block_depth >= 0)
  1380.         xcoffout_end_block (file, last_linenum, pending_blocks[block_depth]);
  1381. #endif
  1382. #ifdef DBX_DEBUGGING_INFO
  1383.       if (write_symbols == DBX_DEBUG && block_depth >= 0)
  1384.         ASM_OUTPUT_INTERNAL_LABEL (file, "LBE",
  1385.                        pending_blocks[block_depth]);
  1386. #endif
  1387. #ifdef SDB_DEBUGGING_INFO
  1388.       if (write_symbols == SDB_DEBUG && block_depth >= 0)
  1389.         sdbout_end_block (file, last_linenum, pending_blocks[block_depth]);
  1390. #endif
  1391. #ifdef DWARF_DEBUGGING_INFO
  1392.       if (write_symbols == DWARF_DEBUG && block_depth >= 1)
  1393.         dwarfout_end_block (pending_blocks[block_depth]);
  1394. #endif
  1395.     }
  1396.       else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL
  1397.            && (debug_info_level == DINFO_LEVEL_NORMAL
  1398.            || debug_info_level == DINFO_LEVEL_VERBOSE))
  1399.     {
  1400. #ifdef DWARF_DEBUGGING_INFO
  1401.           if (write_symbols == DWARF_DEBUG)
  1402.             dwarfout_label (insn);
  1403. #endif
  1404.     }
  1405.       else if (NOTE_LINE_NUMBER (insn) > 0)
  1406.     /* This note is a line-number.  */
  1407.     {
  1408.       register rtx note;
  1409.  
  1410. #if 0 /* This is what we used to do.  */
  1411.       output_source_line (file, insn);
  1412. #endif
  1413.       int note_after = 0;
  1414.  
  1415.       /* If there is anything real after this note,
  1416.          output it.  If another line note follows, omit this one.  */
  1417.       for (note = NEXT_INSN (insn); note; note = NEXT_INSN (note))
  1418.         {
  1419.           if (GET_CODE (note) != NOTE && GET_CODE (note) != CODE_LABEL)
  1420.         break;
  1421.           /* These types of notes can be significant
  1422.          so make sure the preceding line number stays.  */
  1423.           else if (GET_CODE (note) == NOTE
  1424.                && (NOTE_LINE_NUMBER (note) == NOTE_INSN_BLOCK_BEG
  1425.                || NOTE_LINE_NUMBER (note) == NOTE_INSN_BLOCK_END
  1426.                || NOTE_LINE_NUMBER (note) == NOTE_INSN_FUNCTION_BEG))
  1427.           break;
  1428.           else if (GET_CODE (note) == NOTE && NOTE_LINE_NUMBER (note) > 0)
  1429.         {
  1430.           /* Another line note follows; we can delete this note
  1431.              if no intervening line numbers have notes elsewhere.  */
  1432.           int num;
  1433.           for (num = NOTE_LINE_NUMBER (insn) + 1;
  1434.                num < NOTE_LINE_NUMBER (note);
  1435.                num++)
  1436.             if (line_note_exists[num])
  1437.               break;
  1438.  
  1439.           if (num >= NOTE_LINE_NUMBER (note))
  1440.             note_after = 1;
  1441.           break;
  1442.         }
  1443.         }
  1444.  
  1445.       /* Output this line note
  1446.          if it is the first or the last line note in a row.  */
  1447.       if (!note_after)
  1448.         output_source_line (file, insn);
  1449.     }
  1450.       break;
  1451.  
  1452.     case BARRIER:
  1453. #ifdef ASM_OUTPUT_ALIGN_CODE
  1454.       /* Don't litter the assembler output with needless alignments.  A
  1455.      BARRIER will be placed at the end of every function if HAVE_epilogue
  1456.      is true.  */     
  1457.       if (NEXT_INSN (insn))
  1458.     ASM_OUTPUT_ALIGN_CODE (file);
  1459. #endif
  1460.       break;
  1461.  
  1462.     case CODE_LABEL:
  1463.       CC_STATUS_INIT;
  1464.       if (prescan > 0)
  1465.     break;
  1466.       new_block = 1;
  1467. #ifdef SDB_DEBUGGING_INFO
  1468.       if (write_symbols == SDB_DEBUG && LABEL_NAME (insn))
  1469.     sdbout_label (insn);
  1470. #endif
  1471. #ifdef DWARF_DEBUGGING_INFO
  1472.       if (write_symbols == DWARF_DEBUG && LABEL_NAME (insn))
  1473.     dwarfout_label (insn);
  1474. #endif
  1475.       if (app_on)
  1476.     {
  1477.       fprintf (file, ASM_APP_OFF);
  1478.       app_on = 0;
  1479.     }
  1480.       if (NEXT_INSN (insn) != 0
  1481.       && GET_CODE (NEXT_INSN (insn)) == JUMP_INSN)
  1482.     {
  1483.       rtx nextbody = PATTERN (NEXT_INSN (insn));
  1484.  
  1485.       /* If this label is followed by a jump-table,
  1486.          make sure we put the label in the read-only section.  Also
  1487.          possibly write the label and jump table together.  */
  1488.  
  1489.       if (GET_CODE (nextbody) == ADDR_VEC
  1490.           || GET_CODE (nextbody) == ADDR_DIFF_VEC)
  1491.         {
  1492. #ifndef JUMP_TABLES_IN_TEXT_SECTION
  1493.           readonly_data_section ();
  1494. #ifdef READONLY_DATA_SECTION
  1495.           ASM_OUTPUT_ALIGN (file,
  1496.                 exact_log2 (BIGGEST_ALIGNMENT
  1497.                         / BITS_PER_UNIT));
  1498. #endif /* READONLY_DATA_SECTION */
  1499. #else /* JUMP_TABLES_IN_TEXT_SECTION */
  1500.           text_section ();
  1501. #endif /* JUMP_TABLES_IN_TEXT_SECTION */
  1502. #ifdef ASM_OUTPUT_CASE_LABEL
  1503.           ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
  1504.                      NEXT_INSN (insn));
  1505. #else
  1506.           ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
  1507. #endif
  1508.           break;
  1509.         }
  1510.     }
  1511.  
  1512.       ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
  1513.       break;
  1514.  
  1515.     default:
  1516.       {
  1517.     register rtx body = PATTERN (insn);
  1518.     int insn_code_number;
  1519.     char *template;
  1520.     rtx note;
  1521.  
  1522.     /* An INSN, JUMP_INSN or CALL_INSN.
  1523.        First check for special kinds that recog doesn't recognize.  */
  1524.  
  1525.     if (GET_CODE (body) == USE /* These are just declarations */
  1526.         || GET_CODE (body) == CLOBBER)
  1527.       break;
  1528.  
  1529. #ifdef HAVE_cc0
  1530.     /* If there is a REG_CC_SETTER note on this insn, it means that
  1531.        the setting of the condition code was done in the delay slot
  1532.        of the insn that branched here.  So recover the cc status
  1533.        from the insn that set it.  */
  1534.  
  1535.     note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
  1536.     if (note)
  1537.       {
  1538.         NOTICE_UPDATE_CC (PATTERN (XEXP (note, 0)), XEXP (note, 0));
  1539.         cc_prev_status = cc_status;
  1540.       }
  1541. #endif
  1542.  
  1543.     /* Detect insns that are really jump-tables
  1544.        and output them as such.  */
  1545.  
  1546.     if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
  1547.       {
  1548.         register int vlen, idx;
  1549.  
  1550.         if (prescan > 0)
  1551.           break;
  1552.  
  1553.         if (app_on)
  1554.           {
  1555.         fprintf (file, ASM_APP_OFF);
  1556.         app_on = 0;
  1557.           }
  1558.  
  1559.         vlen = XVECLEN (body, GET_CODE (body) == ADDR_DIFF_VEC);
  1560.         for (idx = 0; idx < vlen; idx++)
  1561.           {
  1562.         if (GET_CODE (body) == ADDR_VEC)
  1563.           {
  1564. #ifdef ASM_OUTPUT_ADDR_VEC_ELT
  1565.             ASM_OUTPUT_ADDR_VEC_ELT
  1566.               (file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0)));
  1567. #else
  1568.             abort ();
  1569. #endif
  1570.           }
  1571.         else
  1572.           {
  1573. #ifdef ASM_OUTPUT_ADDR_DIFF_ELT
  1574.             ASM_OUTPUT_ADDR_DIFF_ELT
  1575.               (file,
  1576.                CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)),
  1577.                CODE_LABEL_NUMBER (XEXP (XEXP (body, 0), 0)));
  1578. #else
  1579.             abort ();
  1580. #endif
  1581.           }
  1582.           }
  1583. #ifdef ASM_OUTPUT_CASE_END
  1584.         ASM_OUTPUT_CASE_END (file,
  1585.                  CODE_LABEL_NUMBER (PREV_INSN (insn)),
  1586.                  insn);
  1587. #endif
  1588.  
  1589.         text_section ();
  1590.  
  1591.         break;
  1592.       }
  1593.  
  1594.     /* Do basic-block profiling when we reach a new block.
  1595.        Done here to avoid jump tables.  */
  1596.     if (profile_block_flag && new_block)
  1597.       add_bb (file);
  1598.  
  1599.     if (GET_CODE (body) == ASM_INPUT)
  1600.       {
  1601.         /* There's no telling what that did to the condition codes.  */
  1602.         CC_STATUS_INIT;
  1603.         if (prescan > 0)
  1604.           break;
  1605.         if (! app_on)
  1606.           {
  1607.         fprintf (file, ASM_APP_ON);
  1608.         app_on = 1;
  1609.           }
  1610.         fprintf (asm_out_file, "\t%s\n", XSTR (body, 0));
  1611.         break;
  1612.       }
  1613.  
  1614.     /* Detect `asm' construct with operands.  */
  1615.     if (asm_noperands (body) >= 0)
  1616.       {
  1617.         int noperands = asm_noperands (body);
  1618.         rtx *ops = (rtx *) alloca (noperands * sizeof (rtx));
  1619.         char *string;
  1620.  
  1621.         /* There's no telling what that did to the condition codes.  */
  1622.         CC_STATUS_INIT;
  1623.         if (prescan > 0)
  1624.           break;
  1625.  
  1626.         if (! app_on)
  1627.           {
  1628.         fprintf (file, ASM_APP_ON);
  1629.         app_on = 1;
  1630.           }
  1631.  
  1632.         /* Get out the operand values.  */
  1633.         string = decode_asm_operands (body, ops, NULL_PTR,
  1634.                       NULL_PTR, NULL_PTR);
  1635.         /* Inhibit aborts on what would otherwise be compiler bugs.  */
  1636.         insn_noperands = noperands;
  1637.         this_is_asm_operands = insn;
  1638.  
  1639.         /* Output the insn using them.  */
  1640.         output_asm_insn (string, ops);
  1641.         this_is_asm_operands = 0;
  1642.         break;
  1643.       }
  1644.  
  1645.     if (prescan <= 0 && app_on)
  1646.       {
  1647.         fprintf (file, ASM_APP_OFF);
  1648.         app_on = 0;
  1649.       }
  1650.  
  1651.     if (GET_CODE (body) == SEQUENCE)
  1652.       {
  1653.         /* A delayed-branch sequence */
  1654.         register int i;
  1655.         rtx next;
  1656.  
  1657.         if (prescan > 0)
  1658.           break;
  1659.         final_sequence = body;
  1660.  
  1661.         /* The first insn in this SEQUENCE might be a JUMP_INSN that will
  1662.            force the restoration of a comparison that was previously
  1663.            thought unnecessary.  If that happens, cancel this sequence
  1664.            and cause that insn to be restored.  */
  1665.  
  1666.         next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, prescan, 1);
  1667.         if (next != XVECEXP (body, 0, 1))
  1668.           {
  1669.         final_sequence = 0;
  1670.         return next;
  1671.           }
  1672.  
  1673.         for (i = 1; i < XVECLEN (body, 0); i++)
  1674.           final_scan_insn (XVECEXP (body, 0, i), file, 0, prescan, 1);
  1675. #ifdef DBR_OUTPUT_SEQEND
  1676.         DBR_OUTPUT_SEQEND (file);
  1677. #endif
  1678.         final_sequence = 0;
  1679.  
  1680.         /* If the insn requiring the delay slot was a CALL_INSN, the
  1681.            insns in the delay slot are actually executed before the
  1682.            called function.  Hence we don't preserve any CC-setting
  1683.            actions in these insns and the CC must be marked as being
  1684.            clobbered by the function.  */
  1685.         if (GET_CODE (XVECEXP (body, 0, 0)) == CALL_INSN)
  1686.           CC_STATUS_INIT;
  1687.  
  1688.         /* Following a conditional branch sequence, we have a new basic
  1689.            block.  */
  1690.         if (profile_block_flag)
  1691.           {
  1692.         rtx insn = XVECEXP (body, 0, 0);
  1693.         rtx body = PATTERN (insn);
  1694.  
  1695.         if ((GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET
  1696.              && GET_CODE (SET_SRC (body)) != LABEL_REF)
  1697.             || (GET_CODE (insn) == JUMP_INSN
  1698.             && GET_CODE (body) == PARALLEL
  1699.             && GET_CODE (XVECEXP (body, 0, 0)) == SET
  1700.             && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF))
  1701.           new_block = 1;
  1702.           }
  1703.         break;
  1704.       }
  1705.  
  1706.     /* We have a real machine instruction as rtl.  */
  1707.  
  1708.     body = PATTERN (insn);
  1709.  
  1710. #ifdef HAVE_cc0
  1711.     /* Check for redundant test and compare instructions
  1712.        (when the condition codes are already set up as desired).
  1713.        This is done only when optimizing; if not optimizing,
  1714.        it should be possible for the user to alter a variable
  1715.        with the debugger in between statements
  1716.        and the next statement should reexamine the variable
  1717.        to compute the condition codes.  */
  1718.  
  1719.     if (optimize
  1720.         && GET_CODE (body) == SET
  1721.         && GET_CODE (SET_DEST (body)) == CC0
  1722.         && insn != last_ignored_compare)
  1723.       {
  1724.         if (GET_CODE (SET_SRC (body)) == SUBREG)
  1725.           SET_SRC (body) = alter_subreg (SET_SRC (body));
  1726.         else if (GET_CODE (SET_SRC (body)) == COMPARE)
  1727.           {
  1728.         if (GET_CODE (XEXP (SET_SRC (body), 0)) == SUBREG)
  1729.           XEXP (SET_SRC (body), 0)
  1730.             = alter_subreg (XEXP (SET_SRC (body), 0));
  1731.         if (GET_CODE (XEXP (SET_SRC (body), 1)) == SUBREG)
  1732.           XEXP (SET_SRC (body), 1)
  1733.             = alter_subreg (XEXP (SET_SRC (body), 1));
  1734.           }
  1735.         if ((cc_status.value1 != 0
  1736.          && rtx_equal_p (SET_SRC (body), cc_status.value1))
  1737.         || (cc_status.value2 != 0
  1738.             && rtx_equal_p (SET_SRC (body), cc_status.value2)))
  1739.           {
  1740.         /* Don't delete insn if it has an addressing side-effect.  */
  1741.         if (! FIND_REG_INC_NOTE (insn, 0)
  1742.             /* or if anything in it is volatile.  */
  1743.             && ! volatile_refs_p (PATTERN (insn)))
  1744.           {
  1745.             /* We don't really delete the insn; just ignore it.  */
  1746.             last_ignored_compare = insn;
  1747.             break;
  1748.           }
  1749.           }
  1750.       }
  1751. #endif
  1752.  
  1753.     /* Following a conditional branch, we have a new basic block.
  1754.        But if we are inside a sequence, the new block starts after the
  1755.        last insn of the sequence.  */
  1756.     if (profile_block_flag && final_sequence == 0
  1757.         && ((GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET
  1758.          && GET_CODE (SET_SRC (body)) != LABEL_REF)
  1759.         || (GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == PARALLEL
  1760.             && GET_CODE (XVECEXP (body, 0, 0)) == SET
  1761.             && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF)))
  1762.       new_block = 1;
  1763.  
  1764. #ifndef STACK_REGS
  1765.     /* Don't bother outputting obvious no-ops, even without -O.
  1766.        This optimization is fast and doesn't interfere with debugging.
  1767.        Don't do this if the insn is in a delay slot, since this
  1768.        will cause an improper number of delay insns to be written.  */
  1769.     if (final_sequence == 0
  1770.         && prescan >= 0
  1771.         && GET_CODE (insn) == INSN && GET_CODE (body) == SET
  1772.         && GET_CODE (SET_SRC (body)) == REG
  1773.         && GET_CODE (SET_DEST (body)) == REG
  1774.         && REGNO (SET_SRC (body)) == REGNO (SET_DEST (body)))
  1775.       break;
  1776. #endif
  1777.  
  1778. #ifdef HAVE_cc0
  1779.     /* If this is a conditional branch, maybe modify it
  1780.        if the cc's are in a nonstandard state
  1781.        so that it accomplishes the same thing that it would
  1782.        do straightforwardly if the cc's were set up normally.  */
  1783.  
  1784.     if (cc_status.flags != 0
  1785.         && GET_CODE (insn) == JUMP_INSN
  1786.         && GET_CODE (body) == SET
  1787.         && SET_DEST (body) == pc_rtx
  1788.         && GET_CODE (SET_SRC (body)) == IF_THEN_ELSE
  1789.         /* This is done during prescan; it is not done again
  1790.            in final scan when prescan has been done.  */
  1791.         && prescan >= 0)
  1792.       {
  1793.         /* This function may alter the contents of its argument
  1794.            and clear some of the cc_status.flags bits.
  1795.            It may also return 1 meaning condition now always true
  1796.            or -1 meaning condition now always false
  1797.            or 2 meaning condition nontrivial but altered.  */
  1798.         register int result = alter_cond (XEXP (SET_SRC (body), 0));
  1799.         /* If condition now has fixed value, replace the IF_THEN_ELSE
  1800.            with its then-operand or its else-operand.  */
  1801.         if (result == 1)
  1802.           SET_SRC (body) = XEXP (SET_SRC (body), 1);
  1803.         if (result == -1)
  1804.           SET_SRC (body) = XEXP (SET_SRC (body), 2);
  1805.  
  1806.         /* The jump is now either unconditional or a no-op.
  1807.            If it has become a no-op, don't try to output it.
  1808.            (It would not be recognized.)  */
  1809.         if (SET_SRC (body) == pc_rtx)
  1810.           {
  1811.         PUT_CODE (insn, NOTE);
  1812.         NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
  1813.         NOTE_SOURCE_FILE (insn) = 0;
  1814.         break;
  1815.           }
  1816.         else if (GET_CODE (SET_SRC (body)) == RETURN)
  1817.           /* Replace (set (pc) (return)) with (return).  */
  1818.           PATTERN (insn) = body = SET_SRC (body);
  1819.  
  1820.         /* Rerecognize the instruction if it has changed.  */
  1821.         if (result != 0)
  1822.           INSN_CODE (insn) = -1;
  1823.       }
  1824.  
  1825.     /* Make same adjustments to instructions that examine the
  1826.        condition codes without jumping (if this machine has them).  */
  1827.  
  1828.     if (cc_status.flags != 0
  1829.         && GET_CODE (body) == SET)
  1830.       {
  1831.         switch (GET_CODE (SET_SRC (body)))
  1832.           {
  1833.           case GTU:
  1834.           case GT:
  1835.           case LTU:
  1836.           case LT:
  1837.           case GEU:
  1838.           case GE:
  1839.           case LEU:
  1840.           case LE:
  1841.           case EQ:
  1842.           case NE:
  1843.         {
  1844.           register int result;
  1845.           if (XEXP (SET_SRC (body), 0) != cc0_rtx)
  1846.             break;
  1847.           result = alter_cond (SET_SRC (body));
  1848.           if (result == 1)
  1849.             validate_change (insn, &SET_SRC (body), const_true_rtx, 0);
  1850.           else if (result == -1)
  1851.             validate_change (insn, &SET_SRC (body), const0_rtx, 0);
  1852.           else if (result == 2)
  1853.             INSN_CODE (insn) = -1;
  1854.         }
  1855.           }
  1856.       }
  1857. #endif
  1858.  
  1859.     /* Do machine-specific peephole optimizations if desired.  */
  1860.  
  1861.     if (optimize && !flag_no_peephole && !nopeepholes)
  1862.       {
  1863.         rtx next = peephole (insn);
  1864.         /* When peepholing, if there were notes within the peephole,
  1865.            emit them before the peephole.  */
  1866.         if (next != 0 && next != NEXT_INSN (insn))
  1867.           {
  1868.         rtx prev = PREV_INSN (insn);
  1869.         rtx note;
  1870.  
  1871.         for (note = NEXT_INSN (insn); note != next;
  1872.              note = NEXT_INSN (note))
  1873.           final_scan_insn (note, file, optimize, prescan, nopeepholes);
  1874.  
  1875.         /* In case this is prescan, put the notes
  1876.            in proper position for later rescan.  */
  1877.         note = NEXT_INSN (insn);
  1878.         PREV_INSN (note) = prev;
  1879.         NEXT_INSN (prev) = note;
  1880.         NEXT_INSN (PREV_INSN (next)) = insn;
  1881.         PREV_INSN (insn) = PREV_INSN (next);
  1882.         NEXT_INSN (insn) = next;
  1883.         PREV_INSN (next) = insn;
  1884.           }
  1885.  
  1886.         /* PEEPHOLE might have changed this.  */
  1887.         body = PATTERN (insn);
  1888.       }
  1889.  
  1890.     /* Try to recognize the instruction.
  1891.        If successful, verify that the operands satisfy the
  1892.        constraints for the instruction.  Crash if they don't,
  1893.        since `reload' should have changed them so that they do.  */
  1894.  
  1895.     insn_code_number = recog_memoized (insn);
  1896.     insn_extract (insn);
  1897.     for (i = 0; i < insn_n_operands[insn_code_number]; i++)
  1898.       {
  1899.         if (GET_CODE (recog_operand[i]) == SUBREG)
  1900.           recog_operand[i] = alter_subreg (recog_operand[i]);
  1901.         else if (GET_CODE (recog_operand[i]) == PLUS
  1902.              || GET_CODE (recog_operand[i]) == MULT)
  1903.           recog_operand[i] = walk_alter_subreg (recog_operand[i]);
  1904.       }
  1905.  
  1906.     for (i = 0; i < insn_n_dups[insn_code_number]; i++)
  1907.       {
  1908.         if (GET_CODE (*recog_dup_loc[i]) == SUBREG)
  1909.           *recog_dup_loc[i] = alter_subreg (*recog_dup_loc[i]);
  1910.         else if (GET_CODE (*recog_dup_loc[i]) == PLUS
  1911.              || GET_CODE (*recog_dup_loc[i]) == MULT)
  1912.           *recog_dup_loc[i] = walk_alter_subreg (*recog_dup_loc[i]);
  1913.       }
  1914.  
  1915. #ifdef REGISTER_CONSTRAINTS
  1916.     if (! constrain_operands (insn_code_number, 1))
  1917.       fatal_insn_not_found (insn);
  1918. #endif
  1919.  
  1920.     /* Some target machines need to prescan each insn before
  1921.        it is output.  */
  1922.  
  1923. #ifdef FINAL_PRESCAN_INSN
  1924.     FINAL_PRESCAN_INSN (insn, recog_operand,
  1925.                 insn_n_operands[insn_code_number]);
  1926. #endif
  1927.  
  1928. #ifdef HAVE_cc0
  1929.     cc_prev_status = cc_status;
  1930.  
  1931.     /* Update `cc_status' for this instruction.
  1932.        The instruction's output routine may change it further.
  1933.        If the output routine for a jump insn needs to depend
  1934.        on the cc status, it should look at cc_prev_status.  */
  1935.  
  1936.     NOTICE_UPDATE_CC (body, insn);
  1937. #endif
  1938.  
  1939.     debug_insn = insn;
  1940.  
  1941.     /* If the proper template needs to be chosen by some C code,
  1942.        run that code and get the real template.  */
  1943.  
  1944.     template = insn_template[insn_code_number];
  1945.     if (template == 0)
  1946.       {
  1947.         template = (*insn_outfun[insn_code_number]) (recog_operand, insn);
  1948.  
  1949.         /* If the C code returns 0, it means that it is a jump insn
  1950.            which follows a deleted test insn, and that test insn
  1951.            needs to be reinserted.  */
  1952.         if (template == 0)
  1953.           {
  1954.         if (prev_nonnote_insn (insn) != last_ignored_compare)
  1955.           abort ();
  1956.         new_block = 0;
  1957.         return prev_nonnote_insn (insn);
  1958.           }
  1959.       }
  1960.  
  1961.     /* If the template is the string "#", it means that this insn must
  1962.        be split.  */
  1963.     if (template[0] == '#' && template[1] == '\0')
  1964.       {
  1965.         rtx new = try_split (body, insn, 0);
  1966.  
  1967.         /* If we didn't split the insn, go away.  */
  1968.         if (new == insn && PATTERN (new) == body)
  1969.           abort ();
  1970.           
  1971.         new_block = 0;
  1972.         return new;
  1973.       }
  1974.     
  1975.     if (prescan > 0)
  1976.       break;
  1977.  
  1978.     /* Output assembler code from the template.  */
  1979.  
  1980.     output_asm_insn (template, recog_operand);
  1981.  
  1982. #if 0
  1983.     /* It's not at all clear why we did this and doing so interferes
  1984.        with tests we'd like to do to use REG_WAS_0 notes, so let's try
  1985.        with this out.  */
  1986.  
  1987.     /* Mark this insn as having been output.  */
  1988.     INSN_DELETED_P (insn) = 1;
  1989. #endif
  1990.  
  1991.     debug_insn = 0;
  1992.       }
  1993.     }
  1994.   return NEXT_INSN (insn);
  1995. }
  1996.  
  1997. /* Output debugging info to the assembler file FILE
  1998.    based on the NOTE-insn INSN, assumed to be a line number.  */
  1999.  
  2000. static void
  2001. output_source_line (file, insn)
  2002.      FILE *file;
  2003.      rtx insn;
  2004. {
  2005.   register char *filename = NOTE_SOURCE_FILE (insn);
  2006.  
  2007.   /* Remember filename for basic block profiling.
  2008.      Filenames are allocated on the permanent obstack
  2009.      or are passed in ARGV, so we don't have to save
  2010.      the string.  */
  2011.  
  2012.   if (profile_block_flag && last_filename != filename)
  2013.     bb_file_label_num = add_bb_string (filename, TRUE);
  2014.  
  2015.   last_filename = filename;
  2016.   last_linenum = NOTE_LINE_NUMBER (insn);
  2017.  
  2018.   if (write_symbols != NO_DEBUG)
  2019.     {
  2020. #ifdef SDB_DEBUGGING_INFO
  2021.       if (write_symbols == SDB_DEBUG
  2022. #if 0 /* People like having line numbers even in wrong file!  */
  2023.       /* COFF can't handle multiple source files--lose, lose.  */
  2024.       && !strcmp (filename, main_input_filename)
  2025. #endif
  2026.       /* COFF relative line numbers must be positive.  */
  2027.       && last_linenum > sdb_begin_function_line)
  2028.     {
  2029. #ifdef ASM_OUTPUT_SOURCE_LINE
  2030.       ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
  2031. #else
  2032.       fprintf (file, "\t.ln\t%d\n",
  2033.            ((sdb_begin_function_line > -1)
  2034.             ? last_linenum - sdb_begin_function_line : 1));
  2035. #endif
  2036.     }
  2037. #endif
  2038.  
  2039. #if defined (DBX_DEBUGGING_INFO)
  2040.       if (write_symbols == DBX_DEBUG)
  2041.     dbxout_source_line (file, filename, NOTE_LINE_NUMBER (insn));
  2042. #endif
  2043.  
  2044. #if defined (XCOFF_DEBUGGING_INFO)
  2045.       if (write_symbols == XCOFF_DEBUG)
  2046.     xcoffout_source_line (file, filename, insn);
  2047. #endif
  2048.  
  2049. #ifdef DWARF_DEBUGGING_INFO
  2050.       if (write_symbols == DWARF_DEBUG)
  2051.     dwarfout_line (filename, NOTE_LINE_NUMBER (insn));
  2052. #endif
  2053.     }
  2054. }
  2055.  
  2056. /* If X is a SUBREG, replace it with a REG or a MEM,
  2057.    based on the thing it is a subreg of.  */
  2058.  
  2059. rtx
  2060. alter_subreg (x)
  2061.      register rtx x;
  2062. {
  2063.   register rtx y = SUBREG_REG (x);
  2064.   if (GET_CODE (y) == SUBREG)
  2065.     y = alter_subreg (y);
  2066.  
  2067.   if (GET_CODE (y) == REG)
  2068.     {
  2069.       /* If the containing reg really gets a hard reg, so do we.  */
  2070.       PUT_CODE (x, REG);
  2071.       REGNO (x) = REGNO (y) + SUBREG_WORD (x);
  2072.     }
  2073.   else if (GET_CODE (y) == MEM)
  2074.     {
  2075.       register int offset = SUBREG_WORD (x) * UNITS_PER_WORD;
  2076. #if BYTES_BIG_ENDIAN
  2077.       offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x)))
  2078.          - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (y))));
  2079. #endif
  2080.       PUT_CODE (x, MEM);
  2081.       MEM_VOLATILE_P (x) = MEM_VOLATILE_P (y);
  2082.       XEXP (x, 0) = plus_constant (XEXP (y, 0), offset);
  2083.     }
  2084.  
  2085.   return x;
  2086. }
  2087.  
  2088. /* Do alter_subreg on all the SUBREGs contained in X.  */
  2089.  
  2090. static rtx
  2091. walk_alter_subreg (x)
  2092.      rtx x;
  2093. {
  2094.   switch (GET_CODE (x))
  2095.     {
  2096.     case PLUS:
  2097.     case MULT:
  2098.       XEXP (x, 0) = walk_alter_subreg (XEXP (x, 0));
  2099.       XEXP (x, 1) = walk_alter_subreg (XEXP (x, 1));
  2100.       break;
  2101.  
  2102.     case MEM:
  2103.       XEXP (x, 0) = walk_alter_subreg (XEXP (x, 0));
  2104.       break;
  2105.  
  2106.     case SUBREG:
  2107.       return alter_subreg (x);
  2108.     }
  2109.  
  2110.   return x;
  2111. }
  2112.  
  2113. #ifdef HAVE_cc0
  2114.  
  2115. /* Given BODY, the body of a jump instruction, alter the jump condition
  2116.    as required by the bits that are set in cc_status.flags.
  2117.    Not all of the bits there can be handled at this level in all cases.
  2118.  
  2119.    The value is normally 0.
  2120.    1 means that the condition has become always true.
  2121.    -1 means that the condition has become always false.
  2122.    2 means that COND has been altered.  */
  2123.  
  2124. static int
  2125. alter_cond (cond)
  2126.      register rtx cond;
  2127. {
  2128.   int value = 0;
  2129.  
  2130.   if (cc_status.flags & CC_REVERSED)
  2131.     {
  2132.       value = 2;
  2133.       PUT_CODE (cond, swap_condition (GET_CODE (cond)));
  2134.     }
  2135.  
  2136.   if (cc_status.flags & CC_INVERTED)
  2137.     {
  2138.       value = 2;
  2139.       PUT_CODE (cond, reverse_condition (GET_CODE (cond)));
  2140.     }
  2141.  
  2142.   if (cc_status.flags & CC_NOT_POSITIVE)
  2143.     switch (GET_CODE (cond))
  2144.       {
  2145.       case LE:
  2146.       case LEU:
  2147.       case GEU:
  2148.     /* Jump becomes unconditional.  */
  2149.     return 1;
  2150.  
  2151.       case GT:
  2152.       case GTU:
  2153.       case LTU:
  2154.     /* Jump becomes no-op.  */
  2155.     return -1;
  2156.  
  2157.       case GE:
  2158.     PUT_CODE (cond, EQ);
  2159.     value = 2;
  2160.     break;
  2161.  
  2162.       case LT:
  2163.     PUT_CODE (cond, NE);
  2164.     value = 2;
  2165.     break;
  2166.       }
  2167.  
  2168.   if (cc_status.flags & CC_NOT_NEGATIVE)
  2169.     switch (GET_CODE (cond))
  2170.       {
  2171.       case GE:
  2172.       case GEU:
  2173.     /* Jump becomes unconditional.  */
  2174.     return 1;
  2175.  
  2176.       case LT:
  2177.       case LTU:
  2178.     /* Jump becomes no-op.  */
  2179.     return -1;
  2180.  
  2181.       case LE:
  2182.       case LEU:
  2183.     PUT_CODE (cond, EQ);
  2184.     value = 2;
  2185.     break;
  2186.  
  2187.       case GT:
  2188.       case GTU:
  2189.     PUT_CODE (cond, NE);
  2190.     value = 2;
  2191.     break;
  2192.       }
  2193.  
  2194.   if (cc_status.flags & CC_NO_OVERFLOW)
  2195.     switch (GET_CODE (cond))
  2196.       {
  2197.       case GEU:
  2198.     /* Jump becomes unconditional.  */
  2199.     return 1;
  2200.  
  2201.       case LEU:
  2202.     PUT_CODE (cond, EQ);
  2203.     value = 2;
  2204.     break;
  2205.  
  2206.       case GTU:
  2207.     PUT_CODE (cond, NE);
  2208.     value = 2;
  2209.     break;
  2210.  
  2211.       case LTU:
  2212.     /* Jump becomes no-op.  */
  2213.     return -1;
  2214.       }
  2215.  
  2216.   if (cc_status.flags & (CC_Z_IN_NOT_N | CC_Z_IN_N))
  2217.     switch (GET_CODE (cond))
  2218.       {
  2219.       case LE:
  2220.       case LEU:
  2221.       case GE:
  2222.       case GEU:
  2223.       case LT:
  2224.       case LTU:
  2225.       case GT:
  2226.       case GTU:
  2227.     abort ();
  2228.  
  2229.       case NE:
  2230.     PUT_CODE (cond, cc_status.flags & CC_Z_IN_N ? GE : LT);
  2231.     value = 2;
  2232.     break;
  2233.  
  2234.       case EQ:
  2235.     PUT_CODE (cond, cc_status.flags & CC_Z_IN_N ? LT : GE);
  2236.     value = 2;
  2237.     break;
  2238.       }
  2239.  
  2240.   if (cc_status.flags & CC_NOT_SIGNED)
  2241.     /* The flags are valid if signed condition operators are converted
  2242.        to unsigned.  */
  2243.     switch (GET_CODE (cond))
  2244.       {
  2245.       case LE:
  2246.     PUT_CODE (cond, LEU);
  2247.     value = 2;
  2248.     break;
  2249.  
  2250.       case LT:
  2251.     PUT_CODE (cond, LTU);
  2252.     value = 2;
  2253.     break;
  2254.  
  2255.       case GT:
  2256.     PUT_CODE (cond, GTU);
  2257.     value = 2;
  2258.     break;
  2259.  
  2260.       case GE:
  2261.     PUT_CODE (cond, GEU);
  2262.     value = 2;
  2263.     break;
  2264.       }
  2265.  
  2266.   return value;
  2267. }
  2268. #endif
  2269.  
  2270. /* Report inconsistency between the assembler template and the operands.
  2271.    In an `asm', it's the user's fault; otherwise, the compiler's fault.  */
  2272.  
  2273. void
  2274. output_operand_lossage (str)
  2275.      char *str;
  2276. {
  2277.   if (this_is_asm_operands)
  2278.     error_for_asm (this_is_asm_operands, "invalid `asm': %s", str);
  2279.   else
  2280.     abort ();
  2281. }
  2282.  
  2283. /* Output of assembler code from a template, and its subroutines.  */
  2284.  
  2285. /* Output text from TEMPLATE to the assembler output file,
  2286.    obeying %-directions to substitute operands taken from
  2287.    the vector OPERANDS.
  2288.  
  2289.    %N (for N a digit) means print operand N in usual manner.
  2290.    %lN means require operand N to be a CODE_LABEL or LABEL_REF
  2291.       and print the label name with no punctuation.
  2292.    %cN means require operand N to be a constant
  2293.       and print the constant expression with no punctuation.
  2294.    %aN means expect operand N to be a memory address
  2295.       (not a memory reference!) and print a reference
  2296.       to that address.
  2297.    %nN means expect operand N to be a constant
  2298.       and print a constant expression for minus the value
  2299.       of the operand, with no other punctuation.  */
  2300.  
  2301. void
  2302. output_asm_insn (template, operands)
  2303.      char *template;
  2304.      rtx *operands;
  2305. {
  2306.   register char *p;
  2307.   register int c, i;
  2308.  
  2309.   /* An insn may return a null string template
  2310.      in a case where no assembler code is needed.  */
  2311.   if (*template == 0)
  2312.     return;
  2313.  
  2314.   p = template;
  2315.   putc ('\t', asm_out_file);
  2316.  
  2317. #ifdef ASM_OUTPUT_OPCODE
  2318.   ASM_OUTPUT_OPCODE (asm_out_file, p);
  2319. #endif
  2320.  
  2321.   while (c = *p++)
  2322.     switch (c)
  2323.       {
  2324. #ifdef ASM_OUTPUT_OPCODE
  2325.       case '\n':
  2326.     putc (c, asm_out_file);
  2327.     while ((c = *p) == '\t')
  2328.       {
  2329.         putc (c, asm_out_file);
  2330.         p++;
  2331.       }
  2332.     ASM_OUTPUT_OPCODE (asm_out_file, p);
  2333.     break;
  2334. #endif
  2335.  
  2336. #ifdef ASSEMBLER_DIALECT
  2337.       case '{':
  2338.     /* If we want the first dialect, do nothing.  Otherwise, skip
  2339.        DIALECT_NUMBER of strings ending with '|'.  */
  2340.     for (i = 0; i < dialect_number; i++)
  2341.       {
  2342.         while (*p && *p++ != '|')
  2343.           ;
  2344.  
  2345.         if (*p == '|')
  2346.           p++;
  2347.       }
  2348.     break;
  2349.  
  2350.       case '|':
  2351.     /* Skip to close brace.  */
  2352.     while (*p && *p++ != '}')
  2353.       ;
  2354.     break;
  2355.  
  2356.       case '}':
  2357.     break;
  2358. #endif
  2359.  
  2360.       case '%':
  2361.     /* %% outputs a single %.  */
  2362.     if (*p == '%')
  2363.       {
  2364.         p++;
  2365.         putc (c, asm_out_file);
  2366.       }
  2367.     /* %= outputs a number which is unique to each insn in the entire
  2368.        compilation.  This is useful for making local labels that are
  2369.        referred to more than once in a given insn.  */
  2370.     else if (*p == '=')
  2371.       {
  2372.         p++;
  2373.         fprintf (asm_out_file, "%d", insn_counter);
  2374.       }
  2375.     /* % followed by a letter and some digits
  2376.        outputs an operand in a special way depending on the letter.
  2377.        Letters `acln' are implemented directly.
  2378.        Other letters are passed to `output_operand' so that
  2379.        the PRINT_OPERAND macro can define them.  */
  2380.     else if ((*p >= 'a' && *p <= 'z')
  2381.          || (*p >= 'A' && *p <= 'Z'))
  2382.       {
  2383.         int letter = *p++;
  2384.         c = atoi (p);
  2385.  
  2386.         if (! (*p >= '0' && *p <= '9'))
  2387.           output_operand_lossage ("operand number missing after %-letter");
  2388.         else if (this_is_asm_operands && c >= (unsigned) insn_noperands)
  2389.           output_operand_lossage ("operand number out of range");
  2390.         else if (letter == 'l')
  2391.           output_asm_label (operands[c]);
  2392.         else if (letter == 'a')
  2393.           output_address (operands[c]);
  2394.         else if (letter == 'c')
  2395.           {
  2396.         if (CONSTANT_ADDRESS_P (operands[c]))
  2397.           output_addr_const (asm_out_file, operands[c]);
  2398.         else
  2399.           output_operand (operands[c], 'c');
  2400.           }
  2401.         else if (letter == 'n')
  2402.           {
  2403.         if (GET_CODE (operands[c]) == CONST_INT)
  2404.           fprintf (asm_out_file,
  2405. #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
  2406.                "%d",
  2407. #else
  2408.                "%ld",
  2409. #endif
  2410.                - INTVAL (operands[c]));
  2411.         else
  2412.           {
  2413.             putc ('-', asm_out_file);
  2414.             output_addr_const (asm_out_file, operands[c]);
  2415.           }
  2416.           }
  2417.         else
  2418.           output_operand (operands[c], letter);
  2419.         
  2420.         while ((c = *p) >= '0' && c <= '9') p++;
  2421.       }
  2422.     /* % followed by a digit outputs an operand the default way.  */
  2423.     else if (*p >= '0' && *p <= '9')
  2424.       {
  2425.         c = atoi (p);
  2426.         if (this_is_asm_operands && c >= (unsigned) insn_noperands)
  2427.           output_operand_lossage ("operand number out of range");
  2428.         else
  2429.           output_operand (operands[c], 0);
  2430.         while ((c = *p) >= '0' && c <= '9') p++;
  2431.       }
  2432.     /* % followed by punctuation: output something for that
  2433.        punctuation character alone, with no operand.
  2434.        The PRINT_OPERAND macro decides what is actually done.  */
  2435. #ifdef PRINT_OPERAND_PUNCT_VALID_P
  2436.     else if (PRINT_OPERAND_PUNCT_VALID_P (*p))
  2437.       output_operand (NULL_RTX, *p++);
  2438. #endif
  2439.     else
  2440.       output_operand_lossage ("invalid %%-code");
  2441.     break;
  2442.  
  2443.       default:
  2444.     putc (c, asm_out_file);
  2445.       }
  2446.  
  2447.   if (flag_print_asm_name)
  2448.     {
  2449.       /* Annotate the assembly with a comment describing the pattern and
  2450.      alternative used.  */
  2451.       if (debug_insn)
  2452.     {
  2453.       register int num = INSN_CODE (debug_insn);
  2454.       fprintf (asm_out_file, " %s %d %s", 
  2455.            ASM_COMMENT_START, INSN_UID (debug_insn), insn_name[num]);
  2456.       if (insn_n_alternatives[num] > 1)
  2457.         fprintf (asm_out_file, "/%d", which_alternative + 1);
  2458.  
  2459.       /* Clear this so only the first assembler insn
  2460.          of any rtl insn will get the special comment for -dp.  */
  2461.       debug_insn = 0;
  2462.     }
  2463.     }
  2464.  
  2465.   putc ('\n', asm_out_file);
  2466. }
  2467.  
  2468. /* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol.  */
  2469.  
  2470. void
  2471. output_asm_label (x)
  2472.      rtx x;
  2473. {
  2474.   char buf[256];
  2475.  
  2476.   if (GET_CODE (x) == LABEL_REF)
  2477.     ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (XEXP (x, 0)));
  2478.   else if (GET_CODE (x) == CODE_LABEL)
  2479.     ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x));
  2480.   else
  2481.     output_operand_lossage ("`%l' operand isn't a label");
  2482.  
  2483.   assemble_name (asm_out_file, buf);
  2484. }
  2485.  
  2486. /* Print operand X using machine-dependent assembler syntax.
  2487.    The macro PRINT_OPERAND is defined just to control this function.
  2488.    CODE is a non-digit that preceded the operand-number in the % spec,
  2489.    such as 'z' if the spec was `%z3'.  CODE is 0 if there was no char
  2490.    between the % and the digits.
  2491.    When CODE is a non-letter, X is 0.
  2492.  
  2493.    The meanings of the letters are machine-dependent and controlled
  2494.    by PRINT_OPERAND.  */
  2495.  
  2496. static void
  2497. output_operand (x, code)
  2498.      rtx x;
  2499.      int code;
  2500. {
  2501.   if (x && GET_CODE (x) == SUBREG)
  2502.     x = alter_subreg (x);
  2503.  
  2504.   /* If X is a pseudo-register, abort now rather than writing trash to the
  2505.      assembler file.  */
  2506.  
  2507.   if (x && GET_CODE (x) == REG && REGNO (x) >= FIRST_PSEUDO_REGISTER)
  2508.     abort ();
  2509.  
  2510.   PRINT_OPERAND (asm_out_file, x, code);
  2511. }
  2512.  
  2513. /* Print a memory reference operand for address X
  2514.    using machine-dependent assembler syntax.
  2515.    The macro PRINT_OPERAND_ADDRESS exists just to control this function.  */
  2516.  
  2517. void
  2518. output_address (x)
  2519.      rtx x;
  2520. {
  2521.   walk_alter_subreg (x);
  2522.   PRINT_OPERAND_ADDRESS (asm_out_file, x);
  2523. }
  2524.  
  2525. /* Print an integer constant expression in assembler syntax.
  2526.    Addition and subtraction are the only arithmetic
  2527.    that may appear in these expressions.  */
  2528.  
  2529. void
  2530. output_addr_const (file, x)
  2531.      FILE *file;
  2532.      rtx x;
  2533. {
  2534.   char buf[256];
  2535.  
  2536.  restart:
  2537.   switch (GET_CODE (x))
  2538.     {
  2539.     case PC:
  2540.       if (flag_pic)
  2541.     putc ('.', file);
  2542.       else
  2543.     abort ();
  2544.       break;
  2545.  
  2546.     case SYMBOL_REF:
  2547.       assemble_name (file, XSTR (x, 0));
  2548.       break;
  2549.  
  2550.     case LABEL_REF:
  2551.       ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (XEXP (x, 0)));
  2552.       assemble_name (file, buf);
  2553.       break;
  2554.  
  2555.     case CODE_LABEL:
  2556.       ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x));
  2557.       assemble_name (file, buf);
  2558.       break;
  2559.  
  2560.     case CONST_INT:
  2561.       fprintf (file,
  2562. #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
  2563.            "%d",
  2564. #else
  2565.            "%ld",
  2566. #endif
  2567.            INTVAL (x));
  2568.       break;
  2569.  
  2570.     case CONST:
  2571.       /* This used to output parentheses around the expression,
  2572.      but that does not work on the 386 (either ATT or BSD assembler).  */
  2573.       output_addr_const (file, XEXP (x, 0));
  2574.       break;
  2575.  
  2576.     case CONST_DOUBLE:
  2577.       if (GET_MODE (x) == VOIDmode)
  2578.     {
  2579.       /* We can use %d if the number is one word and positive.  */
  2580.       if (CONST_DOUBLE_HIGH (x))
  2581.         fprintf (file,
  2582. #if HOST_BITS_PER_WIDE_INT == 64
  2583. #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
  2584.              "0x%lx%016lx",
  2585. #else
  2586.              "0x%x%016x",
  2587. #endif
  2588. #else
  2589. #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
  2590.              "0x%lx%08lx",
  2591. #else
  2592.              "0x%x%08x",
  2593. #endif
  2594. #endif
  2595.              CONST_DOUBLE_HIGH (x), CONST_DOUBLE_LOW (x));
  2596.       else if  (CONST_DOUBLE_LOW (x) < 0)
  2597.         fprintf (file,
  2598. #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
  2599.              "0x%x",
  2600. #else
  2601.              "0x%lx",
  2602. #endif
  2603.              CONST_DOUBLE_LOW (x));
  2604.       else
  2605.         fprintf (file,
  2606. #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
  2607.              "%d",
  2608. #else
  2609.              "%ld",
  2610. #endif
  2611.              CONST_DOUBLE_LOW (x));
  2612.     }
  2613.       else
  2614.     /* We can't handle floating point constants;
  2615.        PRINT_OPERAND must handle them.  */
  2616.     output_operand_lossage ("floating constant misused");
  2617.       break;
  2618.  
  2619.     case PLUS:
  2620.       /* Some assemblers need integer constants to appear last (eg masm).  */
  2621.       if (GET_CODE (XEXP (x, 0)) == CONST_INT)
  2622.     {
  2623.       output_addr_const (file, XEXP (x, 1));
  2624.       if (INTVAL (XEXP (x, 0)) >= 0)
  2625.         fprintf (file, "+");
  2626.       output_addr_const (file, XEXP (x, 0));
  2627.     }
  2628.       else
  2629.     {
  2630.       output_addr_const (file, XEXP (x, 0));
  2631.       if (INTVAL (XEXP (x, 1)) >= 0)
  2632.         fprintf (file, "+");
  2633.       output_addr_const (file, XEXP (x, 1));
  2634.     }
  2635.       break;
  2636.  
  2637.     case MINUS:
  2638.       /* Avoid outputting things like x-x or x+5-x,
  2639.      since some assemblers can't handle that.  */
  2640.       x = simplify_subtraction (x);
  2641.       if (GET_CODE (x) != MINUS)
  2642.     goto restart;
  2643.  
  2644.       output_addr_const (file, XEXP (x, 0));
  2645.       fprintf (file, "-");
  2646.       if (GET_CODE (XEXP (x, 1)) == CONST_INT
  2647.       && INTVAL (XEXP (x, 1)) < 0)
  2648.     {
  2649.       fprintf (file, ASM_OPEN_PAREN);
  2650.       output_addr_const (file, XEXP (x, 1));
  2651.       fprintf (file, ASM_CLOSE_PAREN);
  2652.     }
  2653.       else
  2654.     output_addr_const (file, XEXP (x, 1));
  2655.       break;
  2656.  
  2657.     case ZERO_EXTEND:
  2658.     case SIGN_EXTEND:
  2659.       output_addr_const (file, XEXP (x, 0));
  2660.       break;
  2661.  
  2662.     default:
  2663.       output_operand_lossage ("invalid expression as operand");
  2664.     }
  2665. }
  2666.  
  2667. /* A poor man's fprintf, with the added features of %I, %R, %L, and %U.
  2668.    %R prints the value of REGISTER_PREFIX.
  2669.    %L prints the value of LOCAL_LABEL_PREFIX.
  2670.    %U prints the value of USER_LABEL_PREFIX.
  2671.    %I prints the value of IMMEDIATE_PREFIX.
  2672.    %O runs ASM_OUTPUT_OPCODE to transform what follows in the string.
  2673.    Also supported are %d, %x, %s, %e, %f, %g and %%.
  2674.  
  2675.    We handle alternate assembler dialects here, just like output_asm_insn.  */
  2676.  
  2677. void
  2678. asm_fprintf VPROTO((FILE *file, char *p, ...))
  2679. {
  2680. #ifndef __STDC__
  2681.   FILE *file;
  2682.   char *p;
  2683. #endif
  2684.   va_list argptr;
  2685.   char buf[10];
  2686.   char *q, c;
  2687.   int i;
  2688.  
  2689.   VA_START (argptr, p);
  2690.  
  2691. #ifndef __STDC__
  2692.   file = va_arg (argptr, FILE*);
  2693.   p = va_arg (argptr, char*);
  2694. #endif
  2695.  
  2696.   buf[0] = '%';
  2697.  
  2698.   while (c = *p++)
  2699.     switch (c)
  2700.       {
  2701. #ifdef ASSEMBLER_DIALECT
  2702.       case '{':
  2703.     /* If we want the first dialect, do nothing.  Otherwise, skip
  2704.        DIALECT_NUMBER of strings ending with '|'.  */
  2705.     for (i = 0; i < dialect_number; i++)
  2706.       {
  2707.         while (*p && *p++ != '|')
  2708.           ;
  2709.  
  2710.         if (*p == '|')
  2711.           p++;
  2712.       }
  2713.     break;
  2714.  
  2715.       case '|':
  2716.     /* Skip to close brace.  */
  2717.     while (*p && *p++ != '}')
  2718.       ;
  2719.     break;
  2720.  
  2721.       case '}':
  2722.     break;
  2723. #endif
  2724.  
  2725.       case '%':
  2726.     c = *p++;
  2727.     q = &buf[1];
  2728.     while ((c >= '0' && c <= '9') || c == '.')
  2729.       {
  2730.         *q++ = c;
  2731.         c = *p++;
  2732.       }
  2733.     switch (c)
  2734.       {
  2735.       case '%':
  2736.         fprintf (file, "%%");
  2737.         break;
  2738.  
  2739.       case 'd':  case 'i':  case 'u':
  2740.       case 'x':  case 'p':  case 'X':
  2741.       case 'o':
  2742.         *q++ = c;
  2743.         *q = 0;
  2744.         fprintf (file, buf, va_arg (argptr, int));
  2745.         break;
  2746.  
  2747.       case 'w':
  2748.         /* This is a prefix to the 'd', 'i', 'u', 'x', 'p', and 'X' cases,
  2749.            but we do not check for those cases.  It means that the value
  2750.            is a HOST_WIDE_INT, which may be either `int' or `long'.  */
  2751.  
  2752. #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
  2753.         *q++ = 'l';
  2754. #endif
  2755.  
  2756.         *q++ = *p++;
  2757.         *q = 0;
  2758.         fprintf (file, buf, va_arg (argptr, HOST_WIDE_INT));
  2759.         break;
  2760.  
  2761.       case 'l':
  2762.         *q++ = c;
  2763.         *q++ = *p++;
  2764.         *q = 0;
  2765.         fprintf (file, buf, va_arg (argptr, long));
  2766.         break;
  2767.  
  2768.       case 'e':
  2769.       case 'f':
  2770.       case 'g':
  2771.         *q++ = c;
  2772.         *q = 0;
  2773.         fprintf (file, buf, va_arg (argptr, double));
  2774.         break;
  2775.  
  2776.       case 's':
  2777.         *q++ = c;
  2778.         *q = 0;
  2779.         fprintf (file, buf, va_arg (argptr, char *));
  2780.         break;
  2781.  
  2782.       case 'O':
  2783. #ifdef ASM_OUTPUT_OPCODE
  2784.         ASM_OUTPUT_OPCODE (asm_out_file, p);
  2785. #endif
  2786.         break;
  2787.  
  2788.       case 'R':
  2789. #ifdef REGISTER_PREFIX
  2790.         fprintf (file, "%s", REGISTER_PREFIX);
  2791. #endif
  2792.         break;
  2793.  
  2794.       case 'I':
  2795. #ifdef IMMEDIATE_PREFIX
  2796.         fprintf (file, "%s", IMMEDIATE_PREFIX);
  2797. #endif
  2798.         break;
  2799.  
  2800.       case 'L':
  2801. #ifdef LOCAL_LABEL_PREFIX
  2802.         fprintf (file, "%s", LOCAL_LABEL_PREFIX);
  2803. #endif
  2804.         break;
  2805.  
  2806.       case 'U':
  2807. #ifdef USER_LABEL_PREFIX
  2808.         fprintf (file, "%s", USER_LABEL_PREFIX);
  2809. #endif
  2810.         break;
  2811.  
  2812.       default:
  2813.         abort ();
  2814.       }
  2815.     break;
  2816.  
  2817.       default:
  2818.     fputc (c, file);
  2819.       }
  2820. }
  2821.  
  2822. /* Split up a CONST_DOUBLE or integer constant rtx
  2823.    into two rtx's for single words,
  2824.    storing in *FIRST the word that comes first in memory in the target
  2825.    and in *SECOND the other.  */
  2826.  
  2827. void
  2828. split_double (value, first, second)
  2829.      rtx value;
  2830.      rtx *first, *second;
  2831. {
  2832.   if (GET_CODE (value) == CONST_INT)
  2833.     {
  2834.       /* The rule for using CONST_INT for a wider mode
  2835.      is that we regard the value as signed.
  2836.      So sign-extend it.  */
  2837.       rtx high = (INTVAL (value) < 0 ? constm1_rtx : const0_rtx);
  2838. #if WORDS_BIG_ENDIAN
  2839.       *first = high;
  2840.       *second = value;
  2841. #else
  2842.       *first = value;
  2843.       *second = high;
  2844. #endif
  2845.     }
  2846.   else if (GET_CODE (value) != CONST_DOUBLE)
  2847.     {
  2848. #if WORDS_BIG_ENDIAN
  2849.       *first = const0_rtx;
  2850.       *second = value;
  2851. #else
  2852.       *first = value;
  2853.       *second = const0_rtx;
  2854. #endif
  2855.     }
  2856.   else if (GET_MODE (value) == VOIDmode
  2857.        /* This is the old way we did CONST_DOUBLE integers.  */
  2858.        || GET_MODE_CLASS (GET_MODE (value)) == MODE_INT)
  2859.     {
  2860.       /* In an integer, the words are defined as most and least significant.
  2861.      So order them by the target's convention.  */
  2862. #if WORDS_BIG_ENDIAN
  2863.       *first = GEN_INT (CONST_DOUBLE_HIGH (value));
  2864.       *second = GEN_INT (CONST_DOUBLE_LOW (value));
  2865. #else
  2866.       *first = GEN_INT (CONST_DOUBLE_LOW (value));
  2867.       *second = GEN_INT (CONST_DOUBLE_HIGH (value));
  2868. #endif
  2869.     }
  2870.   else
  2871.     {
  2872. #ifdef REAL_ARITHMETIC
  2873.       REAL_VALUE_TYPE r; long l[2];
  2874.       REAL_VALUE_FROM_CONST_DOUBLE (r, value);
  2875.  
  2876.       /* Note, this converts the REAL_VALUE_TYPE to the target's
  2877.      format, splits up the floating point double and outputs
  2878.      exactly 32 bits of it into each of l[0] and l[1] --
  2879.      not necessarily BITS_PER_WORD bits. */
  2880.       REAL_VALUE_TO_TARGET_DOUBLE (r, l);
  2881.  
  2882.       *first = GEN_INT ((HOST_WIDE_INT) l[0]);
  2883.       *second = GEN_INT ((HOST_WIDE_INT) l[1]);
  2884. #else
  2885.       if ((HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT
  2886.        || HOST_BITS_PER_WIDE_INT != BITS_PER_WORD)
  2887.       && ! flag_pretend_float)
  2888.       abort ();
  2889.  
  2890. #if defined (HOST_WORDS_BIG_ENDIAN) == WORDS_BIG_ENDIAN
  2891.       /* Host and target agree => no need to swap.  */
  2892.       *first = GEN_INT (CONST_DOUBLE_LOW (value));
  2893.       *second = GEN_INT (CONST_DOUBLE_HIGH (value));
  2894. #else
  2895.       *second = GEN_INT (CONST_DOUBLE_LOW (value));
  2896.       *first = GEN_INT (CONST_DOUBLE_HIGH (value));
  2897. #endif
  2898. #endif /* no REAL_ARITHMETIC */
  2899.     }
  2900. }
  2901.  
  2902. /* Return nonzero if this function has no function calls.  */
  2903.  
  2904. int
  2905. leaf_function_p ()
  2906. {
  2907.   rtx insn;
  2908.  
  2909.   if (profile_flag || profile_block_flag)
  2910.     return 0;
  2911.  
  2912.   for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
  2913.     {
  2914.       if (GET_CODE (insn) == CALL_INSN)
  2915.     return 0;
  2916.       if (GET_CODE (insn) == INSN
  2917.       && GET_CODE (PATTERN (insn)) == SEQUENCE
  2918.       && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == CALL_INSN)
  2919.     return 0;
  2920.     }
  2921.   for (insn = current_function_epilogue_delay_list; insn; insn = XEXP (insn, 1))
  2922.     {
  2923.       if (GET_CODE (XEXP (insn, 0)) == CALL_INSN)
  2924.     return 0;
  2925.       if (GET_CODE (XEXP (insn, 0)) == INSN
  2926.       && GET_CODE (PATTERN (XEXP (insn, 0))) == SEQUENCE
  2927.       && GET_CODE (XVECEXP (PATTERN (XEXP (insn, 0)), 0, 0)) == CALL_INSN)
  2928.     return 0;
  2929.     }
  2930.  
  2931.   return 1;
  2932. }
  2933.  
  2934. /* On some machines, a function with no call insns
  2935.    can run faster if it doesn't create its own register window.
  2936.    When output, the leaf function should use only the "output"
  2937.    registers.  Ordinarily, the function would be compiled to use
  2938.    the "input" registers to find its arguments; it is a candidate
  2939.    for leaf treatment if it uses only the "input" registers.
  2940.    Leaf function treatment means renumbering so the function
  2941.    uses the "output" registers instead.  */
  2942.  
  2943. #ifdef LEAF_REGISTERS
  2944.  
  2945. static char permitted_reg_in_leaf_functions[] = LEAF_REGISTERS;
  2946.  
  2947. /* Return 1 if this function uses only the registers that can be
  2948.    safely renumbered.  */
  2949.  
  2950. int
  2951. only_leaf_regs_used ()
  2952. {
  2953.   int i;
  2954.  
  2955.   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
  2956.     {
  2957.       if ((regs_ever_live[i] || global_regs[i])
  2958.       && ! permitted_reg_in_leaf_functions[i])
  2959.     return 0;
  2960.     }
  2961.   return 1;
  2962. }
  2963.  
  2964. /* Scan all instructions and renumber all registers into those
  2965.    available in leaf functions.  */
  2966.  
  2967. static void
  2968. leaf_renumber_regs (first)
  2969.      rtx first;
  2970. {
  2971.   rtx insn;
  2972.  
  2973.   /* Renumber only the actual patterns.
  2974.      The reg-notes can contain frame pointer refs,
  2975.      and renumbering them could crash, and should not be needed.  */
  2976.   for (insn = first; insn; insn = NEXT_INSN (insn))
  2977.     if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
  2978.       leaf_renumber_regs_insn (PATTERN (insn));
  2979.   for (insn = current_function_epilogue_delay_list; insn; insn = XEXP (insn, 1))
  2980.     if (GET_RTX_CLASS (GET_CODE (XEXP (insn, 0))) == 'i')
  2981.       leaf_renumber_regs_insn (PATTERN (XEXP (insn, 0)));
  2982. }
  2983.  
  2984. /* Scan IN_RTX and its subexpressions, and renumber all regs into those
  2985.    available in leaf functions.  */
  2986.  
  2987. void
  2988. leaf_renumber_regs_insn (in_rtx)
  2989.      register rtx in_rtx;
  2990. {
  2991.   register int i, j;
  2992.   register char *format_ptr;
  2993.  
  2994.   if (in_rtx == 0)
  2995.     return;
  2996.  
  2997.   /* Renumber all input-registers into output-registers.
  2998.      renumbered_regs would be 1 for an output-register;
  2999.      they  */
  3000.  
  3001.   if (GET_CODE (in_rtx) == REG)
  3002.     {
  3003.       int newreg;
  3004.  
  3005.       /* Don't renumber the same reg twice.  */
  3006.       if (in_rtx->used)
  3007.     return;
  3008.  
  3009.       newreg = REGNO (in_rtx);
  3010.       /* Don't try to renumber pseudo regs.  It is possible for a pseudo reg
  3011.      to reach here as part of a REG_NOTE.  */
  3012.       if (newreg >= FIRST_PSEUDO_REGISTER)
  3013.     {
  3014.       in_rtx->used = 1;
  3015.       return;
  3016.     }
  3017.       newreg = LEAF_REG_REMAP (newreg);
  3018.       if (newreg < 0)
  3019.     abort ();
  3020.       regs_ever_live[REGNO (in_rtx)] = 0;
  3021.       regs_ever_live[newreg] = 1;
  3022.       REGNO (in_rtx) = newreg;
  3023.       in_rtx->used = 1;
  3024.     }
  3025.  
  3026.   if (GET_RTX_CLASS (GET_CODE (in_rtx)) == 'i')
  3027.     {
  3028.       /* Inside a SEQUENCE, we find insns.
  3029.      Renumber just the patterns of these insns,
  3030.      just as we do for the top-level insns.  */
  3031.       leaf_renumber_regs_insn (PATTERN (in_rtx));
  3032.       return;
  3033.     }
  3034.  
  3035.   format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx));
  3036.  
  3037.   for (i = 0; i < GET_RTX_LENGTH (GET_CODE (in_rtx)); i++)
  3038.     switch (*format_ptr++)
  3039.       {
  3040.       case 'e':
  3041.     leaf_renumber_regs_insn (XEXP (in_rtx, i));
  3042.     break;
  3043.  
  3044.       case 'E':
  3045.     if (NULL != XVEC (in_rtx, i))
  3046.       {
  3047.         for (j = 0; j < XVECLEN (in_rtx, i); j++)
  3048.           leaf_renumber_regs_insn (XVECEXP (in_rtx, i, j));
  3049.       }
  3050.     break;
  3051.  
  3052.       case 'S':
  3053.       case 's':
  3054.       case '0':
  3055.       case 'i':
  3056.       case 'w':
  3057.       case 'n':
  3058.       case 'u':
  3059.     break;
  3060.  
  3061.       default:
  3062.     abort ();
  3063.       }
  3064. }
  3065. #endif
  3066.